
timeBench.data.expression.AnchoredPredicate 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.data.expression;
import prefuse.data.Tuple;
import prefuse.data.expression.AbstractPredicate;
import timeBench.data.TemporalElement;
import timeBench.data.TemporalObject;
/**
* Expression that indicates if a {@link TemporalObject} or
* {@link TemporalElement} is anchored.
*
* @author Rind
*/
public class AnchoredPredicate extends AbstractPredicate {
// XXX extend ColumnExpression so that ExpressionAnalyzer#hasDependency() works?
@Override
public boolean getBoolean(Tuple t) {
if (t instanceof TemporalObject) {
return ((TemporalObject) t).getTemporalElement().isAnchored();
} else if (t instanceof TemporalElement) {
return ((TemporalElement) t).asGeneric().isAnchored();
} else {
throw new UnsupportedOperationException(
"AnchoredPredicate only supports temporal objects and elements.");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy