elan.instruction
Class FuncVariable
java.lang.Object
|
+--elan.GrammarElement
|
+--elan.instruction.Instruction
|
+--elan.instruction.FuncVariable
- All Implemented Interfaces:
- java.lang.Comparable
- public class FuncVariable
- extends Instruction
- implements java.lang.Comparable
A variable stores a value and can be used in an expression.
Clients can create many objects representing a variable say "X",
but each of these maps to the same object so that there is a common
value for any occurrence of a named-variable
- See Also:
VariableFactory
|
Field Summary |
protected java.lang.String |
myName
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
myName
protected java.lang.String myName
FuncVariable
public FuncVariable(java.lang.String s)
evaluate
public java.lang.Object evaluate(Context c)
- Description copied from class:
GrammarElement
- Evaluate this language construct in some context. The
evaluation may have side-effects, e.g., moving a turtle.
- Overrides:
evaluate in class Instruction
- Following copied from class:
elan.GrammarElement
- Parameters:
is - the context in which the evaluation takes place- Returns:
- the result of evaluating the construct
value
public StrictInstructionList value(Context c)
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo in interface java.lang.Comparable
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object