Search in sources :

Example 46 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class ExportMetricsFileInstruction method stringToPaths.

private static Vector stringToPaths(String paths) {
    if (paths == null || paths.length() == 0)
        return new Vector();
    ListData list = new ListData(paths);
    Vector result = new Vector();
    for (int i = 0; i < list.size(); i++) result.add(list.get(i));
    return result;
}
Also used : Vector(java.util.Vector) ListData(net.sourceforge.processdash.data.ListData)

Example 47 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class ExportJanitor method startOneTimeExportOperation.

/**
     * Some export operations are performed manually by the user and are not
     * intended for repeated execution.  When we fail to see a repeat of such
     * an operation in the future, we should not interpret it as an indication
     * that the manually exported file is obsolete.  This method is used to
     * frame the beginning of such an operation.
     */
public void startOneTimeExportOperation() {
    SimpleData histList = data.getSimpleValue(HISTORICALLY_EXPORTED_DATANAME);
    if (histList instanceof ListData)
        histList = new ListData((ListData) histList);
    this.originalHistList = histList;
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) ListData(net.sourceforge.processdash.data.ListData)

Example 48 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class ExportJanitor method recordExportedFile.

private static void recordExportedFile(DataContext data, String list, String path) {
    ListData exportedFiles = ListData.asListData(data.getValue(list));
    if (exportedFiles == null) {
        exportedFiles = new ListData();
    }
    exportedFiles.setAdd(normalize(path));
    data.putValue(list, exportedFiles);
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 49 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class EVTaskDependency method getTaskIDs.

public static List getTaskIDs(DataContext data, String taskPath) {
    String dataName = DataRepository.createDataName(taskPath, TASK_ID_DATA_NAME);
    SimpleData currentValue = data.getSimpleValue(dataName);
    ListData list = null;
    if (currentValue == null || currentValue.test() == false)
        return null;
    if (currentValue instanceof ListData)
        list = (ListData) currentValue;
    else if (currentValue instanceof StringData)
        list = ((StringData) currentValue).asList();
    else
        return null;
    List result = new LinkedList();
    for (int i = 0; i < list.size(); i++) result.add(list.get(i));
    if (!result.isEmpty())
        return result;
    else
        return null;
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) NodeList(org.w3c.dom.NodeList) List(java.util.List) StringData(net.sourceforge.processdash.data.StringData) ImmutableStringData(net.sourceforge.processdash.data.ImmutableStringData) LinkedList(java.util.LinkedList) ListData(net.sourceforge.processdash.data.ListData)

Example 50 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class EVTaskDependency method addTaskIDs.

public static void addTaskIDs(DataContext data, String taskPath, String id) {
    if (id == null || id.length() == 0)
        return;
    String dataName = DataRepository.createDataName(taskPath, TASK_ID_DATA_NAME);
    SimpleData currentValue = data.getSimpleValue(dataName);
    ListData newValue;
    if (currentValue instanceof ListData)
        newValue = (ListData) currentValue;
    else if (currentValue instanceof StringData)
        newValue = ((StringData) currentValue).asList();
    else
        newValue = new ListData();
    boolean valueChanged = false;
    String[] idList = id.split(",");
    for (int i = 0; i < idList.length; i++) {
        if (newValue.setAdd(idList[i]))
            valueChanged = true;
    }
    if (valueChanged)
        data.putValue(dataName, newValue);
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) StringData(net.sourceforge.processdash.data.StringData) ImmutableStringData(net.sourceforge.processdash.data.ImmutableStringData) ListData(net.sourceforge.processdash.data.ListData)

Aggregations

ListData (net.sourceforge.processdash.data.ListData)129 SimpleData (net.sourceforge.processdash.data.SimpleData)20 ArrayList (java.util.ArrayList)18 List (java.util.List)16 Iterator (java.util.Iterator)15 StringData (net.sourceforge.processdash.data.StringData)15 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)9 Map (java.util.Map)8 HashSet (java.util.HashSet)7 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)6 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 LinkedList (java.util.LinkedList)5 DoubleData (net.sourceforge.processdash.data.DoubleData)5 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)5 LocalizedString (net.sourceforge.processdash.util.LocalizedString)5 NodeList (org.w3c.dom.NodeList)5 Date (java.util.Date)4 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)4 Element (org.w3c.dom.Element)4