|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.state.StateFactory
public abstract class StateFactory
This class is used to obtain graphs and engines to manage state transitions.
The idiom for using this package is to obtain an instance of this factory and from that an empty state graph. Then to obtain an editor on that graph through which any permitted states and transitions are added. And finally to combine that state graph with an activator in an engine that will manage state the transitions.
Only one instance of a StateFactory is available through the
getInstance() method. The default implementation returned by
this static method can be changed by assigning the system property
com.tomgibara.pronto.state.factory the name of a class which
extends this abstract base class.
| Constructor Summary | |
|---|---|
StateFactory()
|
|
| Method Summary | ||
|---|---|---|
abstract
|
emptyStateGraph()
Creates an empty state graph from which an editor is typically obtained to build any required state graph. |
|
static StateFactory |
getInstance()
Should be called to obtain a StateFactory instance. |
|
abstract
|
newEngine(StateGraph<S,L> graph,
StateActivator<S,L,P> activator)
Combines a graph and activator to form a new engine. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StateFactory()
| Method Detail |
|---|
public static StateFactory getInstance()
throws com.tomgibara.pronto.core.ProntoException
StateFactory instance. This
method is the single entry-point to state management functionality in the
pronto framework.
com.tomgibara.pronto.core.ProntoException - if the factory instance could not be createdpublic abstract <S,L> StateGraph<S,L> emptyStateGraph()
S - the type of states the state graph editor will permitL - the type of labels the state graph editor will permit
public abstract <S,L,P> StateEngine<S,L,P> newEngine(StateGraph<S,L> graph,
StateActivator<S,L,P> activator)
S - the type of states in the graphL - the type of labels in the graphP - the type of parameters accepted by the activatorgraph - the graph of states and transitions permitted by the engineactivator - an object that can 'act' in response to state changes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||