de.xabsl.jxabsl.action
Class Action

java.lang.Object
  extended by de.xabsl.jxabsl.action.Action
Direct Known Subclasses:
ActionBehavior, ActionBooleanOutputSymbol, ActionDecimalOutputSymbol, ActionEnumeratedOutputSymbol

public abstract class Action
extends java.lang.Object

Represents an action execution. This is either a subsequent option or basic behavior to be executed, or an output symbol assignment.


Field Summary
protected  TimeFunction timeFunction
           
 
Constructor Summary
Action(TimeFunction timeFunction)
          Constructor.
 
Method Summary
static ActionBehavior create(Behavior behavior, DebugMessages debug, TimeFunction timeFunction)
          Creates an action definition which just calls a single option or basic behavior without setting any parameters.
static Action create(InputSource input, java.util.Map<java.lang.String,Option> options, Engine engine, OptionParameters optionParameters, TimeFunction timeOfOptionExecution, TimeFunction timeOfStateExecution, java.util.List<Action> actions, DebugMessages debug, TimeFunction timeFunction)
          Creates an action definition.
abstract  void execute()
          Execute the action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeFunction

protected TimeFunction timeFunction
Constructor Detail

Action

public Action(TimeFunction timeFunction)
Constructor.

Parameters:
timeFunction - a pointer to a function that returns the system time in ms.
Method Detail

create

public static ActionBehavior create(Behavior behavior,
                                    DebugMessages debug,
                                    TimeFunction timeFunction)
Creates an action definition which just calls a single option or basic behavior without setting any parameters.

Parameters:
behavior - The referenced option or basic behavior.
debug - A stream for debug messages
timeFunction - a pointer to a function that returns the system time in ms.

create

public static Action create(InputSource input,
                            java.util.Map<java.lang.String,Option> options,
                            Engine engine,
                            OptionParameters optionParameters,
                            TimeFunction timeOfOptionExecution,
                            TimeFunction timeOfStateExecution,
                            java.util.List<Action> actions,
                            DebugMessages debug,
                            TimeFunction timeFunction)
                     throws IntermediateCodeMalformedException
Creates an action definition.

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
optionParameters - The parameters of the option
symbols - All available symbols
timeOfOptionExecution - The time how long the option is already active
timeOfStateExecution - The time how long the current state is already active
actions - The subsequent behaviors i.e options and basic behaviors of the state.
debu - A stream for debug output
timeFunction - a pointer to a function that returns the system time in ms.
Throws:
IntermediateCodeMalformedException

execute

public abstract void execute()
Execute the action.