|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.graph.domain.basic.GraphWrapper
org.apache.commons.graph.domain.basic.DirectedGraphWrapper
org.apache.commons.graph.decorator.DDirectedGraph
org.apache.commons.graph.domain.statemachine.StateMachine
StateMachine - This represents a Finite State Machine. It has a collection of states and transitions which move between them.
Field Summary | |
private GraphFactory |
factory
|
private java.util.Set |
finalStates
|
private MutableDirectedGraph |
graph
|
private java.lang.String |
name
|
private State |
startState
|
private java.util.Map |
states
|
private java.util.Map |
transes
|
Fields inherited from class org.apache.commons.graph.decorator.DDirectedGraph |
|
Fields inherited from class org.apache.commons.graph.domain.basic.DirectedGraphWrapper |
|
Constructor Summary | |
StateMachine(java.lang.String name)
Create a new StateMachine given the name. |
Method Summary | |
void |
addFinalState(State state)
Adds the state to the set of Final States available. |
void |
addState(State state)
Adds a State to the collection of states maintained by the machine. |
void |
addState(java.lang.String name)
Creates a new State with name provided. |
void |
addTransition(java.lang.String name,
State source,
State target)
Adds a feature to the Transition attribute of the StateMachine object. |
void |
addTransition(java.lang.String name,
java.lang.String source,
java.lang.String target)
Add a Transition to the diagram with the name provided. |
void |
addTransition(Transition trans)
Adds a feature to the Transition attribute of the StateMachine object. |
java.lang.String |
getName()
Gets the StateMachines name (or namespace) |
State |
getState(java.lang.String name)
Gets the state attribute of the StateMachine object |
Transition |
getTransition(java.lang.String name)
Gets the Transition associated with the Name. |
void |
setStartState(State state)
Sets the startState attribute of the StateMachine object |
Methods inherited from class org.apache.commons.graph.decorator.DDirectedGraph |
decorateGraph, getWeight, hasConnection, maximumSpanningForest, minimumSpanningForest, setWeight, transpose |
Methods inherited from class org.apache.commons.graph.domain.basic.DirectedGraphWrapper |
getInbound, getOutbound, getSource, getTarget, setDirGraph |
Methods inherited from class org.apache.commons.graph.domain.basic.GraphWrapper |
getEdges, getEdges, getVertices, getVertices, setGraph |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.graph.DirectedGraph |
getInbound, getOutbound, getSource, getTarget |
Methods inherited from interface org.apache.commons.graph.Graph |
getEdges, getEdges, getVertices, getVertices |
Field Detail |
private java.util.Map states
private java.util.Map transes
private java.util.Set finalStates
private State startState
private MutableDirectedGraph graph
private java.lang.String name
private GraphFactory factory
Constructor Detail |
public StateMachine(java.lang.String name)
name
- Name (or Namespace) of StateMachineMethod Detail |
public java.lang.String getName()
public void addState(State state) throws GraphException
GraphException
public void addState(java.lang.String name) throws GraphException
GraphException
public void setStartState(State state)
public void addFinalState(State state)
public void addTransition(java.lang.String name, java.lang.String source, java.lang.String target) throws GraphException
name
- Name of the Transition.source
- Name of the Source State.target
- Name of the Target State.
GraphException
public void addTransition(java.lang.String name, State source, State target) throws GraphException
name
- Name of the Transitionsource
- Source of the Transitiontarget
- Target of the Transition
GraphException
public void addTransition(Transition trans) throws GraphException
GraphException
public State getState(java.lang.String name)
public Transition getTransition(java.lang.String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |