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