|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.christopherschultz.evaluator.Expression net.christopherschultz.evaluator.ConstantExpression net.christopherschultz.evaluator.IdentifierExpression
public class IdentifierExpression
An Expression which represents an identifier.
Constructor Summary | |
---|---|
IdentifierExpression(String identifier)
Creates a new IdentifierExpression with the given identifier. |
Method Summary | |
---|---|
void |
acceptVisitor(ExpressionVisitor visitor)
Accepts an ExpressionVisitor. |
Object |
evaluate(EvaluationContext ec)
Evaluates this Expression by returning its constant value. |
String |
getIdentifier()
Gets the symbol used by this identifier. |
String |
getSymbol()
Gets the symbol used by this identifier. |
String |
toString()
Returns a String representation of this Expression. |
Methods inherited from class net.christopherschultz.evaluator.ConstantExpression |
---|
equals, getSubExpressions, getValue, hashCode |
Methods inherited from class net.christopherschultz.evaluator.Expression |
---|
getParent, setParent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IdentifierExpression(String identifier)
identifier
- The identifier for this IdentifierExpressions.
IllegalArgumentException
- If the identifier is null
or empty.Method Detail |
---|
public String getSymbol()
public String getIdentifier()
public void acceptVisitor(ExpressionVisitor visitor)
Expression
acceptVisitor
in class ConstantExpression
public Object evaluate(EvaluationContext ec) throws EvaluationException
ConstantExpression
evaluate
in class ConstantExpression
ec
- The EvaluationContext in which this expression should
be evaluated.
EvaluationException
- If there is an error evaluating
this Expression.public String toString()
ConstantExpression
toString
in class ConstantExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |