uk.ac.man.cs.rainbow.simulator.rasm
Class And

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.simulator.Instruction
        |
        +--uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
              |
              +--uk.ac.man.cs.rainbow.simulator.rasm.And
All Implemented Interfaces:
Serializable

public class And
extends RASM.BinaryLogicFunction

Bitwise/logical and. Can take any enumerable value as input, and generates integer output, unless both inputs were boolean values, in which case it generates boolean output.

x y x&y

See Also:
Serialized Form

Inner classes inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
Instruction.MACRO
 
Constructor Summary
And()
           
And(RASMCode code)
           
 
Method Summary
protected  boolean execute(boolean x, boolean y)
          Perform a logical binary operation over booleans.
protected  int execute(int x, int y)
          Perform a logical binary operation over integers (bit-wise).
 String toString()
           
 
Methods inherited from class uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
execute
 
Methods inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
addClass, getInstruction, getInstruction, getInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

And

public And()

And

public And(RASMCode code)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

execute

protected int execute(int x,
                      int y)
Description copied from class: RASM.BinaryLogicFunction
Perform a logical binary operation over integers (bit-wise).
Overrides:
execute in class RASM.BinaryLogicFunction
Following copied from class: uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
Parameters:
x - The first (lower on the stack) value argument.
y - The second (higher on the stack) value argument.
Returns:
The result of the operation.

execute

protected boolean execute(boolean x,
                          boolean y)
Description copied from class: RASM.BinaryLogicFunction
Perform a logical binary operation over booleans.
Overrides:
execute in class RASM.BinaryLogicFunction
Following copied from class: uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
Parameters:
x - The first (lower on the stack) value argument.
y - The second (higher on the stack) value argument.
Returns:
The result of the operation.