
timeBench.action.analytical.TemporalDataIndexingAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timebench Show documentation
Show all versions of timebench Show documentation
TimeBench, a flexible, easy-to-use, and reusable software library written in Java that provides foundational data structures and algorithms for time- oriented data in Visual Analytics.
The newest version!
package timeBench.action.analytical;
import timeBench.data.TemporalObject;
/**
* Indexing based on temporal objects occurring at the same temporal element as
* the selected indexing point.
*
* @author Rind
*/
public class TemporalDataIndexingAction extends IndexingAction {
public TemporalDataIndexingAction(String group, String absoluteValueField,
String indexedValueField) {
super(group, absoluteValueField, indexedValueField);
}
public TemporalDataIndexingAction(String group, String absoluteValueField,
String indexedValueField, String categoryField) {
super(group, absoluteValueField, indexedValueField, categoryField);
}
@Override
protected void recalculateFactors() {
factors.clear();
if (indexedPoint != null
&& indexedPoint.getSourceTuple() instanceof TemporalObject) {
TemporalObject obj = (TemporalObject) indexedPoint.getSourceTuple();
for (TemporalObject o : obj.getTemporalElement().temporalObjects(
obj.getTemporalDataset())) {
factors.put(o.get(categoryField),
1.0d / o.getDouble(absoluteValueField));
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy