public interface StateMachine<InputType extends java.lang.Enum<?>,ReturnCodeType extends java.lang.Enum<?>>
When an input is received the receivedInput() method is called. The state machine implementation will execute all input, exit and entry actions which are defined in the FSM. If multiple inputs need to be set/unset, or if inputs must be set/unset during action actions then the setInput() and unsetInput() methods should be used.
Modifier and Type | Method and Description |
---|---|
java.util.List<?> |
getActionDictionary()
Returns a array containing all of the action names in the action
dictionary in index order
|
java.lang.Enum<?> |
getCurrentState()
Query the current state of the state machine.
|
java.lang.String |
getDescription() |
java.lang.Enum<?> |
getInitialState() |
java.util.List<?> |
getInputDictionary()
Returns a array containing all of the input names in the input
dictionary in index order
|
java.lang.String |
getName() |
java.lang.Enum<?> |
getState(int stateId)
Return the name of a state
|
java.util.List<?> |
getStates()
Return a set of state names for the state machine.
|
java.lang.Enum<?> |
lookupAction(int actionId)
Return the name of the action from the action dictionary
|
java.lang.Enum<?> |
lookupInput(int inputId)
Return the name of the input from the input dictionary
|
ReturnCodeType |
receivedInput(InputType input,
java.lang.Object event,
java.lang.Object channel)
Notify the state machine that an input has arrived and process it.
|
void |
setInput(InputType input)
Used prior to a receivedInput call to set additional inputs.
|
void |
unsetInput(InputType input)
Used prior to a receivedInput call to unset inputs.
|
ReturnCodeType receivedInput(InputType input, java.lang.Object event, java.lang.Object channel) throws java.lang.Exception
input
- input to set in the input register of the state
machinejava.lang.Exception
void setInput(InputType input)
input
- input to set in the input registervoid unsetInput(InputType input)
input
- input to unset in the input registerjava.lang.Enum<?> getCurrentState()
java.util.List<?> getStates()
java.lang.Enum<?> getState(int stateId)
stateId
- statejava.lang.String getName()
java.lang.String getDescription()
java.lang.Enum<?> getInitialState()
java.lang.Enum<?> lookupAction(int actionId) throws StateMachineException
actionId
- id of the actionStateMachineException
- when the action id does not existjava.lang.Enum<?> lookupInput(int inputId) throws StateMachineException
inputId
- id of the inputStateMachineException
- when the input id does not existjava.util.List<?> getActionDictionary()
java.util.List<?> getInputDictionary()