|
||||||||||
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.ArrayReferenceExpression
public class ArrayReferenceExpression
An expression describing an array reference.
Constructor Summary | |
---|---|
ArrayReferenceExpression(Expression arrayExp,
Expression indexExp)
Creates a new ArrayReferenceExpression from the specified array and index expressions. |
Method Summary | |
---|---|
void |
acceptVisitor(ExpressionVisitor visitor)
Accepts an ExpressionVisitor. |
Object |
evaluate(EvaluationContext ec)
Evaluates this Expression by evaluating the expression used for the array index, and then returning the element of the array at that location. |
Expression |
getArrayExpression()
Gets the expression that will evaluate to an array. |
String |
getArrayName()
Gets the name of the array, or <anonymous> if
the array will be determined at runtime. |
Expression |
getIndexExpression()
Gets the expression that will evaluate to an index into the array. |
List |
getSubExpressions()
Gets a flattened, depth-first traversal of the expressions in this Expression (including this Expression). |
String |
toString()
|
Methods inherited from class net.christopherschultz.evaluator.Expression |
---|
getParent, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ArrayReferenceExpression(Expression arrayExp, Expression indexExp)
arrayExp
- The expression that will evaluate to the array to index.indexExp
- The expression that will evaluate to the index of the
array.Method Detail |
---|
public void acceptVisitor(ExpressionVisitor visitor)
Expression
acceptVisitor
in class Expression
public Object evaluate(EvaluationContext ec) throws EvaluationException
evaluate
in class Expression
ec
- The context in which this function call should be evaluated.
EvaluationException
- If there is an error evaluating the index
expression or locating the array element.public Expression getArrayExpression()
public Expression getIndexExpression()
public String getArrayName()
<anonymous>
if
the array will be determined at runtime.
public List getSubExpressions()
Expression
getSubExpressions
in class Expression
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |