public class NumericLiteral extends Literal
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
getLiteral, getLiteral, getLiteral
addChildListeners, addExpressionListener, expressionChanged, fireExpressionChange, getBoolean, hasListeners, removeChildListeners, removeExpressionListener, visit
public NumericLiteral(int x)
x
- the literal numeric valuepublic NumericLiteral(long x)
x
- the literal numeric valuepublic NumericLiteral(float x)
x
- the literal numeric valuepublic NumericLiteral(double x)
x
- the literal numeric valuepublic NumericLiteral(java.lang.Object x)
x
- the literal numeric value, must be an instance of
Number
, otherwise an exception will be thrown.public java.lang.Class getType(Schema s)
Expression
public java.lang.Object get(Tuple t)
AbstractExpression
get
in interface Expression
get
in class AbstractExpression
t
- the input TupleExpression.get(prefuse.data.Tuple)
public int getInt(Tuple t)
AbstractExpression
getInt
in interface Expression
getInt
in class AbstractExpression
t
- the input TupleExpression.getInt(prefuse.data.Tuple)
public long getLong(Tuple t)
AbstractExpression
getLong
in interface Expression
getLong
in class AbstractExpression
t
- the input TupleExpression.getLong(prefuse.data.Tuple)
public float getFloat(Tuple t)
AbstractExpression
getFloat
in interface Expression
getFloat
in class AbstractExpression
t
- the input TupleExpression.getFloat(prefuse.data.Tuple)
public double getDouble(Tuple t)
AbstractExpression
getDouble
in interface Expression
getDouble
in class AbstractExpression
t
- the input TupleExpression.getDouble(prefuse.data.Tuple)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright ? 2013 Regents of the University of California