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
           
 
Fields inherited from class elan.GrammarElement
functionMap, ourMap
 
Constructor Summary
FuncVariable(java.lang.String s)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object evaluate(Context c)
          Evaluate this language construct in some context.
 java.lang.String toString()
           
 StrictInstructionList value(Context c)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myName

protected java.lang.String myName
Constructor Detail

FuncVariable

public FuncVariable(java.lang.String s)
Method Detail

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