prefuse.data.expression
Class RangePredicate

java.lang.Object
  extended by prefuse.data.expression.AbstractExpression
      extended by prefuse.data.expression.BinaryExpression
          extended by prefuse.data.expression.RangePredicate
All Implemented Interfaces:
java.util.EventListener, ExpressionListener, Expression, Predicate

public class RangePredicate
extends BinaryExpression
implements Predicate

Predicate instance that evaluates if a value is contained within a bounded range.

Author:
jeffrey heer

Field Summary
static int EX_EX
          Indicates the both the left and right bounds are exclusive
static int EX_IN
          Indicates an exclusive left bound and inclusive right bound
static int IN_EX
          Indicates an inclusive left bound and exclusive right bound
static int IN_IN
          Indicates the both the left and right bounds are inclusive
 
Fields inherited from class prefuse.data.expression.BinaryExpression
m_left, m_op, m_right
 
Constructor Summary
RangePredicate(Expression middle, Expression left, Expression right)
          Create a new RangePredicate.
RangePredicate(Expression middle, Expression left, Expression right, java.util.Comparator cmp)
          Create a new RangePredicate.
RangePredicate(int operation, Expression middle, Expression left, Expression right)
          Create a new RangePredicate.
RangePredicate(int operation, Expression middle, Expression left, Expression right, java.util.Comparator cmp)
          Create a new RangePredicate.
 
Method Summary
protected  void addChildListeners()
          Add child listeners to catch and propagate sub-expression updates.
 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 data values.
 Expression getMiddleExpression()
          Get the middle expression being tested for inclusion in the range
 java.lang.Class getType(Schema s)
          Returns the type that this expression evaluates to when tuples with the given Schema are provided as input.
protected  void removeChildListeners()
          Remove child listeners for sub-expression updates.
 java.lang.String toString()
           
 void visit(ExpressionVisitor v)
          Passes the visitor through this expression and any sub expressions
 
Methods inherited from class prefuse.data.expression.BinaryExpression
getLeftExpression, getOperation, getRightExpression, setLeftExpression, setRightExpression
 
Methods inherited from class prefuse.data.expression.AbstractExpression
addExpressionListener, expressionChanged, fireExpressionChange, getDouble, getFloat, getInt, getLong, hasListeners, removeExpressionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface prefuse.data.expression.Expression
addExpressionListener, getDouble, getFloat, getInt, getLong, removeExpressionListener
 

Field Detail

IN_IN

public static final int IN_IN
Indicates the both the left and right bounds are inclusive

See Also:
Constant Field Values

IN_EX

public static final int IN_EX
Indicates an inclusive left bound and exclusive right bound

See Also:
Constant Field Values

EX_IN

public static final int EX_IN
Indicates an exclusive left bound and inclusive right bound

See Also:
Constant Field Values

EX_EX

public static final int EX_EX
Indicates the both the left and right bounds are exclusive

See Also:
Constant Field Values
Constructor Detail

RangePredicate

public RangePredicate(Expression middle,
                      Expression left,
                      Expression right)
Create a new RangePredicate. Both bounds are assumed to be inclusive.

Parameters:
middle - the value to test for membership in the range
left - the lower range bound
right - the upper range bound

RangePredicate

public RangePredicate(Expression middle,
                      Expression left,
                      Expression right,
                      java.util.Comparator cmp)
Create a new RangePredicate. Both bounds are assumed to be inclusive.

Parameters:
middle - the value to test for membership in the range
left - the lower range bound
right - the upper range bound
cmp - the comparator to use for comparing data values

RangePredicate

public RangePredicate(int operation,
                      Expression middle,
                      Expression left,
                      Expression right)
Create a new RangePredicate.

Parameters:
operation - operation code indicating the inclusiveness / exclusiveness of the bounds
middle - the value to test for membership in the range
left - the lower range bound
right - the upper range bound

RangePredicate

public RangePredicate(int operation,
                      Expression middle,
                      Expression left,
                      Expression right,
                      java.util.Comparator cmp)
Create a new RangePredicate.

Parameters:
operation - operation code indicating the inclusiveness / exclusiveness of the bounds
middle - the value to test for membership in the range
left - the lower range bound
right - the upper range bound
cmp - the comparator to use for comparing data values
Method Detail

getMiddleExpression

public Expression getMiddleExpression()
Get the middle expression being tested for inclusion in the range

Returns:
the middle expression

getComparator

public java.util.Comparator getComparator()
Get the comparator used to compare data values.

Returns:
the comparator used to compare data values

getBoolean

public boolean getBoolean(Tuple t)
Description copied from class: AbstractExpression
By default, throws an UnsupportedOperationException.

Specified by:
getBoolean in interface Expression
Overrides:
getBoolean in class AbstractExpression
Parameters:
t - the input Tuple
Returns:
the Expression return value, as a boolean
See Also:
Expression.getBoolean(prefuse.data.Tuple)

getType

public java.lang.Class getType(Schema s)
Description copied from interface: Expression
Returns the type that this expression evaluates to when tuples with the given Schema are provided as input.

Specified by:
getType in interface Expression
See Also:
Expression.getType(prefuse.data.Schema)

get

public java.lang.Object get(Tuple t)
Description copied from class: AbstractExpression
By default, throws an UnsupportedOperationException.

Specified by:
get in interface Expression
Overrides:
get in class AbstractExpression
Parameters:
t - the input Tuple
Returns:
the Expression return value, as an Object
See Also:
Expression.get(prefuse.data.Tuple)

visit

public void visit(ExpressionVisitor v)
Description copied from interface: Expression
Passes the visitor through this expression and any sub expressions

Specified by:
visit in interface Expression
Overrides:
visit in class BinaryExpression
Parameters:
v - the ExpressionVisitor
See Also:
Expression.visit(prefuse.data.expression.ExpressionVisitor)

addChildListeners

protected void addChildListeners()
Description copied from class: AbstractExpression
Add child listeners to catch and propagate sub-expression updates.

Overrides:
addChildListeners in class BinaryExpression
See Also:
AbstractExpression.addChildListeners()

removeChildListeners

protected void removeChildListeners()
Description copied from class: AbstractExpression
Remove child listeners for sub-expression updates.

Overrides:
removeChildListeners in class BinaryExpression
See Also:
AbstractExpression.removeChildListeners()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2007 Regents of the University of California