model
Class TuringState

java.lang.Object
  extended by model.TuringState

public class TuringState
extends java.lang.Object

A State refers to the state the machine is currently in.

Author:
Nadim Rafehi

Constructor Summary
TuringState(java.lang.String state)
          Takes a string referring to the state of machine.
 
Method Summary
 boolean addInstruction(TuringInstruction instruction)
          Adds an instruction to the instruction list.
 TuringInstruction getInstruction(int input)
          Returns the instruction based on the input.
 java.lang.String getTuringState()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TuringState

public TuringState(java.lang.String state)
Takes a string referring to the state of machine.

Parameters:
state -
Method Detail

getTuringState

public java.lang.String getTuringState()
Returns:
the state

addInstruction

public boolean addInstruction(TuringInstruction instruction)
Adds an instruction to the instruction list.

Parameters:
instruction -

getInstruction

public TuringInstruction getInstruction(int input)
                                 throws java.lang.Exception
Returns the instruction based on the input.

Parameters:
input -
Throws:
java.lang.Exception - if index is out of range

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object