prefuse.visual.expression
Class SearchPredicate

java.lang.Object
  extended by prefuse.data.expression.AbstractExpression
      extended by prefuse.visual.expression.GroupExpression
          extended by prefuse.visual.expression.InGroupPredicate
              extended by prefuse.visual.expression.SearchPredicate
All Implemented Interfaces:
java.util.EventListener, ExpressionListener, Expression, Function, Predicate

public class SearchPredicate
extends InGroupPredicate

Expression that indicates if an item is currently a member of a data group of the type SearchTupleSet, but including a possible special case in which all items should be pass through the predicate if no search query is specified. The data group name is provided by a String-valued sub-expression.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.visual.expression.GroupExpression
m_group
 
Fields inherited from interface prefuse.data.expression.Function
VARARGS
 
Constructor Summary
SearchPredicate()
          Create a new SearchPredicate.
SearchPredicate(boolean includeAllByDefault)
          Create a new SearchPredicate.
SearchPredicate(java.lang.String group, boolean includeAllByDefault)
          Create a new SearchPredicate.
 
Method Summary
 void addParameter(Expression e)
          Attempts to add the given expression as the group expression.
 boolean getBoolean(Tuple t)
          By default, throws an UnsupportedOperationException.
 java.lang.String getName()
          Get the name of this function.
 int getParameterCount()
          Get the maximum number of parameters accepted by this Function.
 java.lang.String toString()
           
 
Methods inherited from class prefuse.visual.expression.InGroupPredicate
get, getType
 
Methods inherited from class prefuse.visual.expression.GroupExpression
getGroup
 
Methods inherited from class prefuse.data.expression.AbstractExpression
addChildListeners, addExpressionListener, expressionChanged, fireExpressionChange, getDouble, getFloat, getInt, getLong, hasListeners, removeChildListeners, removeExpressionListener, visit
 
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, visit
 

Constructor Detail

SearchPredicate

public SearchPredicate()
Create a new SearchPredicate. By default, looks into the Visualization.ALL_ITEMS data group and assumes all items should pass the predicate if no search query has been specified.


SearchPredicate

public SearchPredicate(boolean includeAllByDefault)
Create a new SearchPredicate. By default, looks into the Visualization.ALL_ITEMS data group.

Parameters:
includeAllByDefault - indicates if all items should pass the predicate if no search query has been specified.

SearchPredicate

public SearchPredicate(java.lang.String group,
                       boolean includeAllByDefault)
Create a new SearchPredicate.

Parameters:
group - the data group to look up, should resolve to a SearchTupleSet instance.
includeAllByDefault - indicates if all items should pass the predicate if no search query has been specified.
Method Detail

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 InGroupPredicate
Parameters:
t - the input Tuple
Returns:
the Expression return value, as a boolean
See Also:
Expression.getBoolean(prefuse.data.Tuple)

addParameter

public void addParameter(Expression e)
Description copied from class: GroupExpression
Attempts to add the given expression as the group expression.

Specified by:
addParameter in interface Function
Overrides:
addParameter in class GroupExpression
Parameters:
e - the parameter sub-expression
See Also:
Function.addParameter(prefuse.data.expression.Expression)

getName

public java.lang.String getName()
Description copied from interface: Function
Get the name of this function.

Specified by:
getName in interface Function
Overrides:
getName in class InGroupPredicate
Returns:
the function name
See Also:
Function.getName()

getParameterCount

public int getParameterCount()
Description copied from interface: Function
Get the maximum number of parameters accepted by this Function.

Specified by:
getParameterCount in interface Function
Overrides:
getParameterCount in class GroupExpression
Returns:
the maximum number of parametes accepted, or Function.VARARGS is the number is variable.
See Also:
Function.getParameterCount()

toString

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


Copyright © 2007 Regents of the University of California