it.amattioli.workstate.core
Class MetaSequentialState

Show UML class diagram
java.lang.Object
  extended by it.amattioli.workstate.core.MetaState
      extended by it.amattioli.workstate.core.MetaRealState
          extended by it.amattioli.workstate.core.MetaCompositeState
              extended by it.amattioli.workstate.core.MetaSequentialState
All Implemented Interfaces:
Receiver
Direct Known Subclasses:
MetaMachine

public class MetaSequentialState
extends MetaCompositeState


Constructor Summary
protected MetaSequentialState()
          The no-arguments constructor is used only for serialization/deserialization purposes.
  MetaSequentialState(String tag, StateAction entry, StateAction exit)
          Build a new MetaSequentialState given its tag and its entry and exit actions.
 
Method Summary
protected  void checkAllowedSubstate(MetaState newMetaState)
          Verifies that a MetaState can be a sub-state of this.
 MetaInitialState getInitialState()
          Return the MetaState that represents the initial state of this sequential state.
 State newState(CompositeState parent)
          Create a new State based on this meta-state.
 
Methods inherited from class it.amattioli.workstate.core.MetaCompositeState
addMetaState, getSubstate, getSubstates, isAncestorOf, isSubstate, receive
 
Methods inherited from class it.amattioli.workstate.core.MetaRealState
addAttribute, checkAttribute, equals, getEntryAction, getExitAction, getTag, initialAttributesValues, isAllowedAttribute, toString
 
Methods inherited from class it.amattioli.workstate.core.MetaState
addAvailableEvents, addTransition, checkParentState, descendFrom, findTriggeredTransition, getAvailableEvents, getConfig, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaSequentialState

protected MetaSequentialState()
The no-arguments constructor is used only for serialization/deserialization purposes. It should not be used for other purposes.


MetaSequentialState

public MetaSequentialState(String tag,
                           StateAction entry,
                           StateAction exit)
Build a new MetaSequentialState given its tag and its entry and exit actions.

Parameters:
tag - this state tag
entry - the state entry action or null if no action must be executed when the state is entered
exit - the state exit action or null if no action must be executed when the state is exited
Throws:
NullPointerException - if the tag is null
Method Detail

checkAllowedSubstate

protected void checkAllowedSubstate(MetaState newMetaState)
Description copied from class: MetaCompositeState
Verifies that a MetaState can be a sub-state of this. This method should be called before an attempt to add a new substate to this and verifies that this action is allowed or not. The implementation in this class verifies that there is not another sub-state with the same tag but subclasses are free to redefine this method as long as they call super.checkAllowedSubstate. if the passed MetaState can be a sub-state of this the method will end normally, otherwise an IllegalArgumentException is thrown.

Overrides:
checkAllowedSubstate in class MetaCompositeState
Parameters:
newMetaState - the MetaState that shoud be checked

getInitialState

public MetaInitialState getInitialState()
Return the MetaState that represents the initial state of this sequential state.

Returns:
the MetaState that represents the initial state of this sequential state
Throws:
IllegalStateException - if no initial state has been defined for this sequential state

newState

public State newState(CompositeState parent)
Description copied from class: MetaState
Create a new State based on this meta-state. Implementations of this method must call MetaState.checkParentState(CompositeState) to check that the passed state is admittable as parent state for the state that will be created.

Specified by:
newState in class MetaState
Parameters:
parent - the parent state for the state that will be created
Returns:
the new state


Copyright © 2011. All Rights Reserved.