Search in sources :

Example 51 with ListData

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

the class EVTask method getNodeTypeSpecValue.

protected String getNodeTypeSpecValue(String key, String defaulVal) {
    ListData spec = getAcceptableNodeTypes();
    if (spec == null)
        return defaulVal;
    String prefix = "(" + key + ":";
    for (int i = 0; i < spec.size(); i++) {
        String specItem = (String) spec.get(i);
        if (specItem.startsWith(prefix) && specItem.endsWith(")"))
            return specItem.substring(prefix.length(), specItem.length() - 1);
    }
    return defaulVal;
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 52 with ListData

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

the class EVSchedule method setPeriodNoteData.

public void setPeriodNoteData(String noteData) {
    periodNotes = new TreeMap<Date, String>();
    if (noteData != null && noteData.length() > 0) {
        ListData data = new ListData(noteData);
        for (int i = 1; i < data.size(); i += 2) {
            try {
                Date date = parseDate((String) data.get(i - 1));
                String note = (String) data.get(i);
                periodNotes.put(date, note);
            } catch (Exception e) {
            // bad data - try to continue with the next element.
            }
        }
    }
}
Also used : Date(java.util.Date) NoSuchElementException(java.util.NoSuchElementException) ListData(net.sourceforge.processdash.data.ListData)

Example 53 with ListData

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

the class EVSchedule method getSaveList.

public synchronized ListData getSaveList() {
    ListData result = new ListData();
    result.add(saveDate(get(0).endDate));
    Period p;
    for (int i = 1; i < periods.size(); i++) {
        p = get(i);
        if (p.automatic)
            break;
        result.add(Double.toString(p.planTotalTime));
        result.add(saveDate(p.endDate));
    }
    result.setImmutable();
    return result;
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 54 with ListData

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

the class UserGroupManagerDash method saveDataElements.

private void saveDataElements(UserFilter f) {
    saveDataElement(f.getId(), NAME_SUFFIX, StringData.create(f.toString()));
    ListData datasetIDs = new ListData();
    for (String oneID : f.getDatasetIDs()) datasetIDs.add(oneID);
    if (datasetIDs.test() == false)
        datasetIDs.add(EMPTY_GROUP_TOKEN);
    saveDataElement(f.getId(), DATASET_IDS_SUFFIX, datasetIDs);
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 55 with ListData

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

the class FilterDataContainingLabels method scrambleTaggedData.

private String scrambleTaggedData(String value, String tag) {
    List<String> labelData = StringData.create(value).asList().asList();
    ListData newVal = new ListData();
    for (String elem : labelData) {
        if (elem.startsWith(tag)) {
            String label = elem.substring(tag.length());
            elem = tag + labelMapper.getString(label);
        }
        newVal.add(elem);
    }
    return newVal.saveString().substring(1);
}
Also used : 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