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;
}
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.
}
}
}
}
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;
}
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);
}
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);
}
Aggregations