prefuse.data.expression
Class NumericLiteral

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

public class NumericLiteral
extends Literal

Literal expression of a numeric value.

Author:
jeffrey heer

Constructor Summary
NumericLiteral(double x)
          Create a new double NumericLiteral.
NumericLiteral(float x)
          Create a new float NumericLiteral.
NumericLiteral(int x)
          Create a new integer NumericLiteral.
NumericLiteral(long x)
          Create a new long NumericLiteral.
NumericLiteral(java.lang.Object x)
          Create a new NumericLiteral.
 
Method Summary
 java.lang.Object get(Tuple t)
          By default, throws an UnsupportedOperationException.
 double getDouble(Tuple t)
          By default, throws an UnsupportedOperationException.
 float getFloat(Tuple t)
          By default, throws an UnsupportedOperationException.
 int getInt(Tuple t)
          By default, throws an UnsupportedOperationException.
 long getLong(Tuple t)
          By default, throws an UnsupportedOperationException.
 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()
           
 
Methods inherited from class prefuse.data.expression.Literal
getLiteral, getLiteral, getLiteral
 
Methods inherited from class prefuse.data.expression.AbstractExpression
addChildListeners, addExpressionListener, expressionChanged, fireExpressionChange, getBoolean, hasListeners, removeChildListeners, removeExpressionListener, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericLiteral

public NumericLiteral(int x)
Create a new integer NumericLiteral.

Parameters:
x - the literal numeric value

NumericLiteral

public NumericLiteral(long x)
Create a new long NumericLiteral.

Parameters:
x - the literal numeric value

NumericLiteral

public NumericLiteral(float x)
Create a new float NumericLiteral.

Parameters:
x - the literal numeric value

NumericLiteral

public NumericLiteral(double x)
Create a new double NumericLiteral.

Parameters:
x - the literal numeric value

NumericLiteral

public NumericLiteral(java.lang.Object x)
Create a new NumericLiteral.

Parameters:
x - the literal numeric value, must be an instance of Number, otherwise an exception will be thrown.
Method Detail

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.

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)

getInt

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

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

getLong

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

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

getFloat

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

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

getDouble

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

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

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