org.echarts
Class Machine

java.lang.Object
  extended by org.echarts.Machine
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BasicMachine, StateMachine

public abstract class Machine
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static AnyPseudostateConfiguration ANY_CONFIG
           
static BasicStateConfiguration BASIC_CONFIG
           
static DeepHistoryPseudostateConfiguration DEEP_HISTORY_CONFIG
           
static DefaultInitialPseudostateConfiguration DEFAULT_INITIAL_CONFIG
           
static NewPseudostateConfiguration NEW_CONFIG
           
static long serialVersionUID
           
static TerminalPseudostateConfiguration TERMINAL_CONFIG
           
static VariableStateConfiguration VARIABLE_CONFIG
           
 
Constructor Summary
Machine(java.lang.String machineName, Machine parentMachine, int machineIndex, MachineCode machineCode)
           
 
Method Summary
protected abstract  void clearSubmachineReference(int index)
          Invoked by destroySubmachine() to clear variable in user machine that references the submachine with the specified index e.g.
static boolean getDefaultMachineDebugging()
           
static boolean getDefaultMachineDebuggingGlobalStateOutput()
           
static MachineMonitor getDefaultMachineMonitor()
           
static MachineMonitorEventFilter getDefaultMachineMonitorFilter()
           
static boolean getDefaultMachineMonitoring()
           
 boolean getMachineDebugging()
           
 boolean getMachineDebuggingGlobalStateOutput()
           
 java.lang.String getMachineID()
          Returns string representation of this machine's ID.
 int getMachineIndex()
          Returns this machine's index in the context of its parent machine.
 MachineMonitor getMachineMonitor()
           
 boolean getMachineMonitoring()
           
 Machine getParentMachine()
          Returns reference to this machine's parent machine, or null if this machine is the root machine.
 Machine getRootMachine()
          Returns reference to this machine's root machine.
static boolean getSystemDebugging()
           
static boolean getSystemMonitoring()
           
abstract  java.lang.String globalStateString()
          Returns formatted image of machine's global state.
abstract  java.lang.String globalStateString(StateConfiguration config, TransitionMachine firedMachine)
          Returns formated image of machine's global state that has changed as a result of firing transition with specified relative target state configuration.
abstract  java.lang.String localStateString()
          Returns formatted image of machine's local state.
abstract  java.lang.String localStateString(StateConfiguration config, TransitionMachine firedMachine)
          Returns formated image of machine's local state that has changed as a result of firing transition with specified relative target state configuration.
 void putEvent(MachineMonitorEvent event)
          Put an event into the machine's monitor if machine monitoring and system monitoring enabled.
static void setDebugging(boolean value)
          Short-hand for calling setDefaultMachineDebugging(), setDefaultMachineMonitoring(), setSystemDebugging(), and setSystemMonitoring().
static boolean setDefaultMachineDebugging(boolean newValue)
          Set default debugging flag used for newly created machine instances.
static boolean setDefaultMachineDebuggingGlobalStateOutput(boolean newValue)
          Set optional state output debugging flag used for root machine.
static MachineMonitor setDefaultMachineMonitor(MachineMonitor newValue)
          Set default monitor value used for newly created machine instances.
static MachineMonitorEventFilter setDefaultMachineMonitorFilter(MachineMonitorEventFilter newValue)
          Set default monitor filter value used for newly created machine instances.
static boolean setDefaultMachineMonitoring(boolean newValue)
          Set/clear default monitoring flag used for newly created machine instances.
 boolean setMachineDebugging(boolean value)
          Set/clear debug flag for this machine and any of its submachines.
 boolean setMachineDebuggingGlobalStateOutput(boolean value)
          Set/clear global state output debug flag for root machine.
 MachineMonitor setMachineMonitor(MachineMonitor monitor)
          Sets monitor for this machine and all submachines.
 boolean setMachineMonitoring(boolean value)
          Set/clear monitoring flag for this machine and any of its submachines.
static boolean setSystemDebugging(boolean newValue)
          Set default debugging flag used for all machine instances.
static boolean setSystemMonitoring(boolean newValue)
          Set/clear monitoring flag for all machine instances.
 java.lang.String statePathString()
          Returns this machine's state path string.
 java.lang.String toString()
          Returns formatted image of machine's global state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

DEEP_HISTORY_CONFIG

public static final DeepHistoryPseudostateConfiguration DEEP_HISTORY_CONFIG

DEFAULT_INITIAL_CONFIG

public static final DefaultInitialPseudostateConfiguration DEFAULT_INITIAL_CONFIG

TERMINAL_CONFIG

public static final TerminalPseudostateConfiguration TERMINAL_CONFIG

VARIABLE_CONFIG

public static final VariableStateConfiguration VARIABLE_CONFIG

NEW_CONFIG

public static final NewPseudostateConfiguration NEW_CONFIG

ANY_CONFIG

public static final AnyPseudostateConfiguration ANY_CONFIG

BASIC_CONFIG

public static final BasicStateConfiguration BASIC_CONFIG
Constructor Detail

Machine

public Machine(java.lang.String machineName,
               Machine parentMachine,
               int machineIndex,
               MachineCode machineCode)
        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setSystemMonitoring

public static final boolean setSystemMonitoring(boolean newValue)
Set/clear monitoring flag for all machine instances.


getSystemMonitoring

public static final boolean getSystemMonitoring()

setDefaultMachineMonitoring

public static final boolean setDefaultMachineMonitoring(boolean newValue)
Set/clear default monitoring flag used for newly created machine instances.


getDefaultMachineMonitoring

public static final boolean getDefaultMachineMonitoring()

setDefaultMachineMonitor

public static final MachineMonitor setDefaultMachineMonitor(MachineMonitor newValue)
Set default monitor value used for newly created machine instances.


getDefaultMachineMonitor

public static final MachineMonitor getDefaultMachineMonitor()

setDefaultMachineMonitorFilter

public static final MachineMonitorEventFilter setDefaultMachineMonitorFilter(MachineMonitorEventFilter newValue)
Set default monitor filter value used for newly created machine instances.


getDefaultMachineMonitorFilter

public static final MachineMonitorEventFilter getDefaultMachineMonitorFilter()

setSystemDebugging

public static final boolean setSystemDebugging(boolean newValue)
Set default debugging flag used for all machine instances.


getSystemDebugging

public static final boolean getSystemDebugging()

setDefaultMachineDebugging

public static final boolean setDefaultMachineDebugging(boolean newValue)
Set default debugging flag used for newly created machine instances.


getDefaultMachineDebugging

public static final boolean getDefaultMachineDebugging()

setDebugging

public static final void setDebugging(boolean value)
Short-hand for calling setDefaultMachineDebugging(), setDefaultMachineMonitoring(), setSystemDebugging(), and setSystemMonitoring().


setDefaultMachineDebuggingGlobalStateOutput

public static final boolean setDefaultMachineDebuggingGlobalStateOutput(boolean newValue)
Set optional state output debugging flag used for root machine.


getDefaultMachineDebuggingGlobalStateOutput

public static final boolean getDefaultMachineDebuggingGlobalStateOutput()

setMachineMonitor

public MachineMonitor setMachineMonitor(MachineMonitor monitor)
Sets monitor for this machine and all submachines.


getMachineMonitor

public MachineMonitor getMachineMonitor()

setMachineMonitoring

public boolean setMachineMonitoring(boolean value)
Set/clear monitoring flag for this machine and any of its submachines.


getMachineMonitoring

public final boolean getMachineMonitoring()

setMachineDebugging

public boolean setMachineDebugging(boolean value)
Set/clear debug flag for this machine and any of its submachines.


getMachineDebugging

public final boolean getMachineDebugging()

setMachineDebuggingGlobalStateOutput

public boolean setMachineDebuggingGlobalStateOutput(boolean value)
Set/clear global state output debug flag for root machine.


getMachineDebuggingGlobalStateOutput

public final boolean getMachineDebuggingGlobalStateOutput()

putEvent

public void putEvent(MachineMonitorEvent event)
              throws java.lang.Exception
Put an event into the machine's monitor if machine monitoring and system monitoring enabled. Add root machine ID, machine class and machine state path to the event's properties.

Throws:
java.lang.Exception

clearSubmachineReference

protected abstract void clearSubmachineReference(int index)
Invoked by destroySubmachine() to clear variable in user machine that references the submachine with the specified index e.g. if an or-machine declares a submachine for initial state S1, then the variable 'S1' that refers to the submachine instance will be set to null. This method is generated by the machine translator for each user machine.


getParentMachine

public final Machine getParentMachine()
Returns reference to this machine's parent machine, or null if this machine is the root machine.


getRootMachine

public final Machine getRootMachine()
Returns reference to this machine's root machine.


getMachineID

public final java.lang.String getMachineID()
Returns string representation of this machine's ID.


getMachineIndex

public final int getMachineIndex()
Returns this machine's index in the context of its parent machine.


statePathString

public java.lang.String statePathString()
Returns this machine's state path string. The string identifies the path of state names starting from the root machine down to this machine, excluding this machine's current state.


globalStateString

public abstract java.lang.String globalStateString(StateConfiguration config,
                                                   TransitionMachine firedMachine)
                                            throws java.lang.Exception
Returns formated image of machine's global state that has changed as a result of firing transition with specified relative target state configuration. We assume target configuration is satisfied by current machine state.

Throws:
java.lang.Exception

globalStateString

public abstract java.lang.String globalStateString()
Returns formatted image of machine's global state.


localStateString

public abstract java.lang.String localStateString(StateConfiguration config,
                                                  TransitionMachine firedMachine)
                                           throws java.lang.Exception
Returns formated image of machine's local state that has changed as a result of firing transition with specified relative target state configuration. We assume target configuration is satisfied by current machine state.

Throws:
java.lang.Exception

localStateString

public abstract java.lang.String localStateString()
Returns formatted image of machine's local state.


toString

public java.lang.String toString()
Returns formatted image of machine's global state.

Overrides:
toString in class java.lang.Object