Package org.jboss.security.util.state
Class State
- java.lang.Object
-
- org.jboss.security.util.state.State
-
public class State extends Object
The respresentation of a state in a state machine.- Version:
- $Revision$
- Author:
- Scott.Stark@jboss.org
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description State
addTransition(Transition transition)
Add a transition to the allowed transition map.Object
getData()
String
getName()
Get the state name.Transition
getTransition(String name)
Lookup an allowed transition given its name.Map
getTransitions()
Get the Mapof allowed transitions for this state. boolean
isAcceptState()
An accept state is indicated by no transitionsvoid
setData(Object data)
String
toString()
-
-
-
Method Detail
-
getName
public String getName()
Get the state name.- Returns:
- the name of the state.
-
getData
public Object getData()
-
setData
public void setData(Object data)
-
isAcceptState
public boolean isAcceptState()
An accept state is indicated by no transitions- Returns:
- true if this is an accept state, false otherwise.
-
addTransition
public State addTransition(Transition transition)
Add a transition to the allowed transition map.- Parameters:
transition
-- Returns:
- this to allow chained addTransition calls
-
getTransition
public Transition getTransition(String name)
Lookup an allowed transition given its name.- Parameters:
name
- - the name of a valid transition from this state.- Returns:
- the valid transition if it exists, null otherwise.
-
getTransitions
public Map getTransitions()
Get the Mapof allowed transitions for this state. - Returns:
- the allowed transitions map.
-
-