model
Class TuringStateManager

java.lang.Object
  extended by model.TuringStateManager

public class TuringStateManager
extends java.lang.Object

Stores the TuringStates.

Author:
nadim

Constructor Summary
TuringStateManager()
          Creates a Manager object to store TuringStates
 
Method Summary
 boolean addTuringState(TuringState state)
          Add a TuringState to the collection.
 TuringState getCurrentState()
          Get the current TuringState.
 TuringState[] getStates()
          Returns a TuringState array containing the values of the state
 boolean setCurrentState(java.lang.String stateName)
          Set the current TuringState to the specified index.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TuringStateManager

public TuringStateManager()
Creates a Manager object to store TuringStates

Method Detail

addTuringState

public boolean addTuringState(TuringState state)
Add a TuringState to the collection. If this is the first state to be added, it will be set as the default state.

Returns:
false if a state with the same name exists

getCurrentState

public TuringState getCurrentState()
Get the current TuringState.

Returns:
the current state

setCurrentState

public boolean setCurrentState(java.lang.String stateName)
Set the current TuringState to the specified index.

Returns:
false if a state with the same name exists

getStates

public TuringState[] getStates()
Returns a TuringState array containing the values of the state

Returns:

toString

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