public class IfExpression extends AbstractExpression
| Constructor and Description |
|---|
IfExpression(Predicate test,
Expression thenExpr,
Expression elseExpr)
Create a new IfExpression.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChildListeners()
Add child listeners to catch and propagate sub-expression updates.
|
java.lang.Object |
get(Tuple t)
By default, throws an UnsupportedOperationException.
|
boolean |
getBoolean(Tuple t)
By default, throws an UnsupportedOperationException.
|
double |
getDouble(Tuple t)
By default, throws an UnsupportedOperationException.
|
Expression |
getElseExpression()
Get the else expression
|
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.
|
Predicate |
getTestPredicate()
Get the test predicate.
|
Expression |
getThenExpression()
Get the then expression
|
java.lang.Class |
getType(Schema s)
Returns the type that this expression evaluates to when tuples
with the given Schema are provided as input.
|
protected void |
removeChildListeners()
Remove child listeners for sub-expression updates.
|
void |
setElseExpression(Expression e)
Set the else expression
|
void |
setTestPredicate(Predicate p)
Set the test predicate.
|
void |
setThenExpression(Expression e)
Set the then expression
|
java.lang.String |
toString() |
void |
visit(ExpressionVisitor v)
Passes the visitor through this expression and any sub expressions
|
addExpressionListener, expressionChanged, fireExpressionChange, hasListeners, removeExpressionListenerpublic IfExpression(Predicate test, Expression thenExpr, Expression elseExpr)
test - the predicate test for the if statementthenExpr - the expression to evaluate if the test predicate
evaluates to trueelseExpr - the expression to evaluate if the test predicate
evaluates to falsepublic Predicate getTestPredicate()
public Expression getThenExpression()
public Expression getElseExpression()
public void setTestPredicate(Predicate p)
p - the test predicatepublic void setThenExpression(Expression e)
e - the then expression to setpublic void setElseExpression(Expression e)
e - the else expression to setpublic java.lang.Class getType(Schema s)
ExpressionExpression.getType(prefuse.data.Schema)public java.lang.Object get(Tuple t)
AbstractExpressionget in interface Expressionget in class AbstractExpressiont - the input TupleExpression.get(prefuse.data.Tuple)public boolean getBoolean(Tuple t)
AbstractExpressiongetBoolean in interface ExpressiongetBoolean in class AbstractExpressiont - the input TupleExpression.getBoolean(prefuse.data.Tuple)public double getDouble(Tuple t)
AbstractExpressiongetDouble in interface ExpressiongetDouble in class AbstractExpressiont - the input TupleExpression.getDouble(prefuse.data.Tuple)public float getFloat(Tuple t)
AbstractExpressiongetFloat in interface ExpressiongetFloat in class AbstractExpressiont - the input TupleExpression.getFloat(prefuse.data.Tuple)public int getInt(Tuple t)
AbstractExpressiongetInt in interface ExpressiongetInt in class AbstractExpressiont - the input TupleExpression.getInt(prefuse.data.Tuple)public long getLong(Tuple t)
AbstractExpressiongetLong in interface ExpressiongetLong in class AbstractExpressiont - the input TupleExpression.getLong(prefuse.data.Tuple)public void visit(ExpressionVisitor v)
Expressionvisit in interface Expressionvisit in class AbstractExpressionv - the ExpressionVisitorExpression.visit(prefuse.data.expression.ExpressionVisitor)protected void addChildListeners()
AbstractExpressionaddChildListeners in class AbstractExpressionAbstractExpression.addChildListeners()protected void removeChildListeners()
AbstractExpressionremoveChildListeners in class AbstractExpressionAbstractExpression.removeChildListeners()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()