slogo.instruction.conditional
Class Equal

java.lang.Object
  extended by slogo.language.GrammarElement
      extended by slogo.instruction.Instruction
          extended by slogo.instruction.conditional.ConditionalInstruction
              extended by slogo.instruction.conditional.Equal

public class Equal
extends ConditionalInstruction

Author:
tshishikub

Field Summary
 
Fields inherited from class slogo.instruction.conditional.ConditionalInstruction
e1, e2
 
Fields inherited from class slogo.language.GrammarElement
gelementsToValue
 
Constructor Summary
Equal(GrammarElement e1, GrammarElement e2)
           
 
Method Summary
 java.lang.Integer evaluate(Context c)
          Evaluate this language construct in some context.
 
Methods inherited from class slogo.instruction.conditional.ConditionalInstruction
firstValue, secondValue
 
Methods inherited from class slogo.instruction.Instruction
evaluateNumericExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Equal

public Equal(GrammarElement e1,
             GrammarElement e2)
Method Detail

evaluate

public java.lang.Integer 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.

Specified by:
evaluate in class ConditionalInstruction
Parameters:
c - context in which the evaluation takes place
Returns:
1 if the two inputs are equal, 0 otherwise