A State
represents one of the conditions that a caplin.trading.statemachine.StateMachine
StateMachine can be in. The complete set of states are held within a caplin.trading.statemachine.StateModel
StateModel object, and the network diagram between those states is modeled as a list of possible state transitions
from each State
object.
Attributes | Name and Description |
---|---|
|
caplin.trading.statemachine.State(String sName, int nTimeout, int sTimeoutState)
Constructs a new instance of |
Attributes | Name and Description |
---|---|
|
void
addTransition(caplin.trading.statemachine.Transition oTransition)
Adds a state transition from this state, to some other state. |
|
Map
getAttributes()
Returns a map of name value pairs associated with this state. |
|
String
getName()
Returns the name of this state. |
|
int
getTimeout()
Returns the number of seconds after which this state will automatically timeout to another state. |
|
String
getTimeoutState()
Returns the state that will be transitioned to, if this state times out. |
|
caplin.trading.statemachine.Transition
getTransition(String sEvent)
Returns the transition that will be used should the given event fire. |
|
boolean
isFinalState()
Returns |
►
caplin.trading.statemachine.State(String sName, int nTimeout, int sTimeoutState)
Constructs a new instance of caplin.trading.statemachine.State
with the specified attributes.
String | sName | The name of this state. |
int | nTimeout | (Optional) The number of seconds after which this state will automatically timeout to another state. |
int | sTimeoutState | (Optional) The state that will be transitioned to, if this state times out. |
sName
is not a valid string.
►
void
addTransition(caplin.trading.statemachine.Transition oTransition)
Adds a state transition from this state, to some other state.
caplin.trading.statemachine.Transition | oTransition | The transition to add — this may not share a trigger event with an already added caplin.trading.statemachine.Transition. |
null
, or is not a valid instance of
caplin.trading.statemachine.Transition.
►
Map
getAttributes()
Returns a map of name value pairs associated with this state.
This method provides a simple way for applications to associate attribute information with particular states. How this may be used, or why this might be useful, is dependent on each application, but a concrete example within the reference implementation is to store the disabled state for a text field. If the caplin.trading.statemachine.StateMachine is created from an XML file, these attributes will also be specified within the XML configuration.
►
String
getName()
Returns the name of this state.
►
int
getTimeout()
Returns the number of seconds after which this state will automatically timeout to another state.
null
if no timeout has been configured.
►
String
getTimeoutState()
Returns the state that will be transitioned to, if this state times out.
null
if no timeout state has been configured.
►
caplin.trading.statemachine.Transition
getTransition(String sEvent)
Returns the transition that will be used should the given event fire.
String | sEvent | A trigger event that could fire. |
►
boolean
isFinalState()
Returns true
if there are no other states that can be transitioned to from this state.