it.amattioli.workstate.core
Class MetaSequentialState
java.lang.Object
it.amattioli.workstate.core.MetaState
it.amattioli.workstate.core.MetaRealState
it.amattioli.workstate.core.MetaCompositeState
it.amattioli.workstate.core.MetaSequentialState
- All Implemented Interfaces:
- Receiver
- Direct Known Subclasses:
- MetaMachine
public class MetaSequentialState
- extends MetaCompositeState
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 tagentry - the state entry action or null if no action must be executed
when the state is enteredexit - the state exit action or null if no action must be executed
when the state is exited
- Throws:
NullPointerException - if the tag is null
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.