de.xabsl.jxabsl.state
Class State

java.lang.Object
  extended by de.xabsl.jxabsl.symbols.NamedItem
      extended by de.xabsl.jxabsl.state.State

public class State
extends NamedItem

Represents a single state


Field Summary
 
Fields inherited from class de.xabsl.jxabsl.symbols.NamedItem
debug, name
 
Constructor Summary
State(java.lang.String name, DebugMessages debug, TimeFunction timeFunction)
          Constructor.
 
Method Summary
 void create(InputSource input, java.util.Map<java.lang.String,Option> options, Engine engine, java.util.Map<java.lang.String,State> states, OptionParameters parameters, TimeFunction timeOfOptionExecution)
          Creates the state and its subelements from the intermediate code.
 java.util.List<Action> getActions()
           
 State getNextState()
          Executes the decision tree and determines the next active state (can be the same).
 boolean isTargetState()
          Returns wheter the state is a target state
 void reset()
          Sets the time when the state was activated to 0
 java.lang.String toString()
           
 
Methods inherited from class de.xabsl.jxabsl.symbols.NamedItem
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

State

public State(java.lang.String name,
             DebugMessages debug,
             TimeFunction timeFunction)
Constructor. Does not create the state.

Parameters:
name - The name of the state. For debugging purposes.
debug - For debugging output
timeFunction - a function that returns the system time in ms.
Method Detail

create

public void create(InputSource input,
                   java.util.Map<java.lang.String,Option> options,
                   Engine engine,
                   java.util.Map<java.lang.String,State> states,
                   OptionParameters parameters,
                   TimeFunction timeOfOptionExecution)
            throws IntermediateCodeMalformedException
Creates the state and its subelements from the intermediate code.

Parameters:
input - An input source for the intermediate code. It must be opened and read until A position where a state starts.
options - All available options
basicBehaviors - All available basicBehaviors
states - All states of the option
parameters - The parameters of the option
symbols - All available symbols
timeOfOptionExecution - The time how long the option is already active
Throws:
IntermediateCodeMalformedException

getNextState

public State getNextState()
Executes the decision tree and determines the next active state (can be the same).


reset

public void reset()
Sets the time when the state was activated to 0


isTargetState

public boolean isTargetState()
Returns wheter the state is a target state


getActions

public java.util.List<Action> getActions()

toString

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