|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.workstate.core.MetaState
public abstract class MetaState
A MetaState represents the configuration of a possible state of a
Machine. Every instance of the machine will use the same
MetaState to retrieve configuration informations like:
| Constructor Summary | |
|---|---|
MetaState()
|
|
| Method Summary | |
|---|---|
void |
addAvailableEvents(Collection<MetaEvent> coll)
Add to the passed collection all the MetaEvents receivable by the
machine when it is in a state based on this. |
void |
addTransition(Transition transition)
Add a Transition exiting from this meta-state. |
protected void |
checkParentState(CompositeState parent)
Check if the parameter could be the parent state of a State based
on this. |
boolean |
descendFrom(MetaCompositeState metaState)
Check if the parameter is an ancestor of this meta-state. |
Transition |
findTriggeredTransition(Event event,
State state)
Find a transition triggered by a given Event when the machine is
in a State based on this. |
Collection<MetaEvent> |
getAvailableEvents()
Return all the MetaEvents receivable by the machine when it is in
a state based on this. |
Configuration |
getConfig()
|
MetaCompositeState |
getParent()
Return the parent meta-state |
abstract State |
newState(CompositeState parent)
Create a new State based on this meta-state. |
void |
setParent(MetaCompositeState parent)
Set the parent of this meta-state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface it.amattioli.workstate.info.Receiver |
|---|
receive |
| Constructor Detail |
|---|
public MetaState()
| Method Detail |
|---|
public abstract State newState(CompositeState parent)
State based on this meta-state. Implementations of
this method must call checkParentState(CompositeState) to check
that the passed state is admittable as parent state for the state that
will be created.
parent - the parent state for the state that will be created
IllegalArgumentException - if the parameter is not admittable as parent state for the
state that will be createdpublic void setParent(MetaCompositeState parent)
MetaState is
created the parent is set to null. This means that the meta-state is a
root one but can be later changed using this method. This method doesn't
check that the parent state has this as one of its sub-states. It is a
caller responsibility to assure this.
parent - the new parent meta-statepublic MetaCompositeState getParent()
protected void checkParentState(CompositeState parent)
State based
on this. If it is not so an exception will be raised.
parent - the state to be checked
IllegalArgumentException - if the parameter cannot be the parent state of a
State based on thispublic boolean descendFrom(MetaCompositeState metaState)
metaState -
NullPointerException - if the parameter is nullpublic void addTransition(Transition transition)
Transition exiting from this meta-state.
transition - the new transition that will exit this meta-state
NullPointerException - if the parameter is null
IllegalArgumentException - if already exists a transition exiting from this meta-state
triggered by the same event and with an identical guard
public Transition findTriggeredTransition(Event event,
State state)
Event when the machine is
in a State based on this. Only the transitions directly exiting
from this meta-state will be searched.
event - the received eventstate - the current state
public Configuration getConfig()
public void addAvailableEvents(Collection<MetaEvent> coll)
MetaEvents receivable by the
machine when it is in a state based on this.
coll - the collection to which the MetaEvents will be addedpublic Collection<MetaEvent> getAvailableEvents()
MetaEvents receivable by the machine when it is in
a state based on this.
MetaEvents receivable by the machine when it is
in a state based on this
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||