prefuse.visual.expression
Class GroupExpression

java.lang.Object
  extended by prefuse.data.expression.AbstractExpression
      extended by prefuse.visual.expression.GroupExpression
All Implemented Interfaces:
java.util.EventListener, ExpressionListener, Expression, Function
Direct Known Subclasses:
GroupSizeFunction, InGroupPredicate, QueryExpression

public abstract class GroupExpression
extends AbstractExpression
implements Function

Abstract base class for Expression instances dealing with data groups within a Visualization. Maintains an Expression that serves as the paremter to this Function; this Expression should return a valid group name when evaluated on a given Tuple.

Author:
jeffrey heer

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

Field Detail

m_group

protected Expression m_group
Constructor Detail

GroupExpression

protected GroupExpression()
Create a new GroupExpression.


GroupExpression

protected GroupExpression(java.lang.String group)
Create a new GroupExpression over the given group name.

Parameters:
group - the data group name
Method Detail

getGroup

protected java.lang.String getGroup(Tuple t)
Evaluate the group name expression for the given Tuple

Parameters:
t - the input Tuple to the group name expression
Returns:
the String result of the expression

addParameter

public void addParameter(Expression e)
Attempts to add the given expression as the group expression.

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

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
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 java.lang.Object
See Also:
Object.toString()


Copyright © 2007 Regents of the University of California