prefuse.data.expression
Class Literal

java.lang.Object
  extended by prefuse.data.expression.AbstractExpression
      extended by prefuse.data.expression.Literal
All Implemented Interfaces:
java.util.EventListener, ExpressionListener, Expression
Direct Known Subclasses:
BooleanLiteral, NumericLiteral, ObjectLiteral

public abstract class Literal
extends AbstractExpression

Abstarct base class for a Literal Expression that evaluates to a constant value.

Author:
jeffrey heer

Constructor Summary
Literal()
           
 
Method Summary
static Literal getLiteral(java.lang.Object val)
          Return the given object as a new Literal instance.
static Literal getLiteral(java.lang.Object val, java.lang.Class type)
          Return the given object as a new Literal instance.
static Literal getLiteral(Tuple t, java.lang.String field)
          Evaluate the given tuple and data field and return the result as a new Literal instance.
 
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, toString, wait, wait, wait
 
Methods inherited from interface prefuse.data.expression.Expression
getType
 

Constructor Detail

Literal

public Literal()
Method Detail

getLiteral

public static Literal getLiteral(Tuple t,
                                 java.lang.String field)
Evaluate the given tuple and data field and return the result as a new Literal instance.

Parameters:
t - the Tuple
field - the data field to lookup
Returns:
a new Literal expression containing the value of the Tuple's data field

getLiteral

public static Literal getLiteral(java.lang.Object val)
Return the given object as a new Literal instance.

Parameters:
val - the object value
Returns:
a new Literal expression containing the object value. The type is assumed to be the value's concrete runtime type.

getLiteral

public static Literal getLiteral(java.lang.Object val,
                                 java.lang.Class type)
Return the given object as a new Literal instance.

Parameters:
val - the object value
type - the type the literal should take
Returns:
a new Literal expression containing the object value


Copyright © 2007 Regents of the University of California