com.eg.agent.android.harvest.ActivityTraces Maven / Gradle / Ivy
package com.eg.agent.android.harvest;
import com.eg.agent.android.harvest.type.HarvestableArray;
import com.eg.agent.android.trace.ActivityTrace;
import com.eg.google.gson.JsonArray;
import java.util.ArrayList;
import java.util.Collection;
public class ActivityTraces extends HarvestableArray {
private final Collection activityTraces = new ArrayList();
public JsonArray asJsonArray() {
JsonArray array = new JsonArray();
for (ActivityTrace activityTrace : this.activityTraces) {
array.add(activityTrace.asJson());
}
return array;
}
public synchronized void add(ActivityTrace activityTrace) {
this.activityTraces.add(activityTrace);
}
public synchronized void remove(ActivityTrace activityTrace) {
this.activityTraces.remove(activityTrace);
}
public void clear() {
this.activityTraces.clear();
}
public int count() {
return this.activityTraces.size();
}
public Collection getActivityTraces() {
return this.activityTraces;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy