All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eg.agent.android.harvest.ActivityTraces Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
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