|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.workstate.core.MetaState
it.amattioli.workstate.core.MetaRealState
it.amattioli.workstate.core.MetaCompositeState
public abstract class MetaCompositeState
A MetaCompositeState is the configuration of a state that can have sub-states. This abstract class has facility methods to manipulate these sub-states: adding a sub-state, checking a sub-state existence, etc.
| Constructor Summary | |
|---|---|
MetaCompositeState(String tag,
StateAction entry,
StateAction exit)
Construct a new MetaCompositeState given its identifier (tag) and its entry and exit action. |
|
| Method Summary | |
|---|---|
void |
addMetaState(MetaState newMetaState)
Add a sub-state to this state. |
protected void |
checkAllowedSubstate(MetaState newMetaState)
Verifies that a MetaState can be a sub-state of this. |
MetaState |
getSubstate(String tag)
Returns, if exists, the sub-state of this state with a given tag. |
Collection<MetaState> |
getSubstates()
Returns an (unmodifiable) collection containing the sub-state of this state. |
boolean |
isAncestorOf(MetaState metaState)
Check if this meta-state is a super-state of the passed one. |
boolean |
isSubstate(String tag)
Verifies if this state has a sub-state whose tag is passed as a parameter. |
void |
receive(Visitor visitor)
|
| 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, newState, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetaCompositeState(String tag,
StateAction entry,
StateAction exit)
tag - this state identifierentry - this state entry action. Passing null means no action should
be performedexit - this state exit action. Passing null means no action should be
performed
NullPointerException - if the tag is null| Method Detail |
|---|
protected void checkAllowedSubstate(MetaState newMetaState)
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.
newMetaState - the MetaState that shoud be checked
IllegalArgumentException - if the argument cannot be a sub-state
of this statepublic void addMetaState(MetaState newMetaState)
checkAllowedSubstate(MetaState).
newMetaState - the new sub-state
NullPointerException - if the parameter is null
IllegalArgumentException - if the parameter cannot be a sub-state
of this statepublic boolean isAncestorOf(MetaState metaState)
metaState -
NullPointerException - if the parameter is nullpublic Collection<MetaState> getSubstates()
public boolean isSubstate(String tag)
tag - the tag of the sub-state
public MetaState getSubstate(String tag)
IllegalArgumentException is thrown.
public void receive(Visitor visitor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||