public class ComparisonPredicate extends BinaryExpression implements Predicate
Modifier and Type | Field and Description |
---|---|
static int |
EQ
Indicates a equals comparison.
|
static int |
GT
Indicates a greater-than comparison.
|
static int |
GTEQ
Indicates a greater-than-or-equals comparison.
|
static int |
LT
Indicates a less-than comparison.
|
static int |
LTEQ
Indicates a less-than-or-equals comparison.
|
static int |
NEQ
Indicates a not-equals comparison.
|
m_left, m_op, m_right
Constructor and Description |
---|
ComparisonPredicate(int operation,
Expression left,
Expression right)
Create a new ComparisonPredicate.
|
ComparisonPredicate(int operation,
Expression left,
Expression right,
java.util.Comparator cmp)
Create a new ComparisonPredicate.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(Tuple t)
By default, throws an UnsupportedOperationException.
|
boolean |
getBoolean(Tuple t)
By default, throws an UnsupportedOperationException.
|
java.util.Comparator |
getComparator()
Get the comparator used to compare instances.
|
java.lang.Class |
getType(Schema s)
Returns the type that this expression evaluates to when tuples
with the given Schema are provided as input.
|
java.lang.String |
toString() |
addChildListeners, getLeftExpression, getOperation, getRightExpression, removeChildListeners, setLeftExpression, setRightExpression, visit
addExpressionListener, expressionChanged, fireExpressionChange, getDouble, getFloat, getInt, getLong, hasListeners, removeExpressionListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addExpressionListener, getDouble, getFloat, getInt, getLong, removeExpressionListener, visit
public static final int LT
public static final int GT
public static final int EQ
public static final int NEQ
public static final int LTEQ
public static final int GTEQ
public ComparisonPredicate(int operation, Expression left, Expression right)
operation
- the comparison operation to computeleft
- the left sub-expressionright
- the right sub-expressionpublic ComparisonPredicate(int operation, Expression left, Expression right, java.util.Comparator cmp)
operation
- the comparison operation to computeleft
- the left sub-expressionright
- the right sub-expressioncmp
- the comparator to use to compare valuespublic java.util.Comparator getComparator()
public java.lang.Class getType(Schema s)
Expression
getType
in interface Expression
Expression.getType(prefuse.data.Schema)
public boolean getBoolean(Tuple t)
AbstractExpression
getBoolean
in interface Expression
getBoolean
in class AbstractExpression
t
- the input TupleExpression.getBoolean(prefuse.data.Tuple)
public java.lang.Object get(Tuple t)
AbstractExpression
get
in interface Expression
get
in class AbstractExpression
t
- the input TupleExpression.get(prefuse.data.Tuple)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright ? 2013 Regents of the University of California