de.fhg.igd.jhsm
Class HSMState

java.lang.Object
  extended byde.fhg.igd.jhsm.AbstractComponent
      extended byde.fhg.igd.jhsm.HSMState
All Implemented Interfaces:
Component, Serializable, State
Direct Known Subclasses:
HSM, Pseudostate

public class HSMState
extends AbstractComponent
implements State

A generic state.

Author:
Jan Haevecker
See Also:
Serialized Form

Field Summary
private  List deferredEvents_
           
private  Action entry_
           
private  Action exit_
           
private  Logger LOG
           
private  Set transitions_
           
 
Fields inherited from class de.fhg.igd.jhsm.AbstractComponent
 
Constructor Summary
HSMState()
          Default constructor.
HSMState(String name)
          Convenience constructor.
 
Method Summary
 void action(Context context)
          Performs the component's action in a specified context.
 void addDeferred(Event event)
          Adds an event to the list of events that should be deferred.
 void addTransition(Transition transition)
          Attaches a transition to this state.
 boolean defers(Event event)
          Checks if a given event is deferred by this state.
 void entry(Context context)
          Executes the entry action of the state.
 void exit(Context context)
          Executes the exit action of the state.
 List getDeferred()
          Returns all Events that are deferred by this state.
 Set getTransitions()
          Returns all transitions that have been attached to this state.
 void removeDeferred(Event event)
          Removes an event from the list of events that should be deferred.
 void removeTransition(Transition transition)
          Removes a transition from this state.
 void setEntry(Action action)
          Sets the action object that is executed on entry of this state.
 void setExit(Action action)
          Sets the action object that is executed on exit of this state.
 
Methods inherited from class de.fhg.igd.jhsm.AbstractComponent
getAction, getName, getParent, setAction, setName, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.fhg.igd.jhsm.Component
getAction, getName, getParent, setAction, setName, setParent
 

Field Detail

LOG

private final Logger LOG

transitions_

private Set transitions_

deferredEvents_

private List deferredEvents_

entry_

private Action entry_

exit_

private Action exit_
Constructor Detail

HSMState

public HSMState()
Default constructor.


HSMState

public HSMState(String name)
Convenience constructor. Note that the provided name is for debugging purposes only.

Parameters:
name - The name that can be used for text outputs. Note that the name is for debugging purposes only.
Method Detail

action

public void action(Context context)
Description copied from interface: Component
Performs the component's action in a specified context. This is the hook for the interpreter.

Specified by:
action in interface Component
Parameters:
context - Used to publish and retrieve data for/from other actions.

addDeferred

public void addDeferred(Event event)
Description copied from interface: State
Adds an event to the list of events that should be deferred.

Specified by:
addDeferred in interface State

addTransition

public void addTransition(Transition transition)
Description copied from interface: State
Attaches a transition to this state.

Specified by:
addTransition in interface State
Parameters:
transition - The transition that should be attached.

entry

public void entry(Context context)
Description copied from interface: State
Executes the entry action of the state.

Specified by:
entry in interface State
Parameters:
context - The context for the given action.

exit

public void exit(Context context)
Description copied from interface: State
Executes the exit action of the state.

Specified by:
exit in interface State
Parameters:
context - The context for the given action.

removeDeferred

public void removeDeferred(Event event)
Description copied from interface: State
Removes an event from the list of events that should be deferred.

Specified by:
removeDeferred in interface State

getTransitions

public Set getTransitions()
Description copied from interface: State
Returns all transitions that have been attached to this state.

Specified by:
getTransitions in interface State
Returns:
A set of transition objects.

removeTransition

public void removeTransition(Transition transition)
Description copied from interface: State
Removes a transition from this state.

Specified by:
removeTransition in interface State
Parameters:
transition - The transition that should be removed.

setExit

public void setExit(Action action)
Description copied from interface: State
Sets the action object that is executed on exit of this state.

Specified by:
setExit in interface State

setEntry

public void setEntry(Action action)
Description copied from interface: State
Sets the action object that is executed on entry of this state.

Specified by:
setEntry in interface State

defers

public boolean defers(Event event)
Description copied from interface: State
Checks if a given event is deferred by this state.

Specified by:
defers in interface State
Parameters:
event - The event that should be checked.
Returns:
true if the event is deferred by the state, false else.

getDeferred

public List getDeferred()
Description copied from interface: State
Returns all Events that are deferred by this state.

Specified by:
getDeferred in interface State
Returns:
A set of events objects.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.