| Constructor and Description |
|---|
SimpleModel(Class<S> stateClass)
Constructs a
SimpleModel given an Enum of the possible states of a FiniteStateMachine. |
| Modifier and Type | Method and Description |
|---|---|
void |
addStateEntryAction(S state, StateEntryAction<S> stateEntryAction)
Adds/overrides the
StateEntryAction for the specified state in the Model. |
void |
addStateExitAction(S state, StateExitAction<S> stateExitAction)
Adds/overrides the
StateExitAction for the specified state in the Model. |
void |
addTransition(Transition<S> transition)
Adds the specified
Transition to the Model. |
S |
getState(String sName)
Obtains the state with the specified name from the
SimpleModel. |
Class<S> |
getStateClass()
|
Map<S,StateEntryAction<S>> |
getStateEntryActions()
Obtains the
StateEntryActions defined for the states in the Model. |
Map<S,StateExitAction<S>> |
getStateExitActions()
Obtains the
StateExitActions defined for the states in the Model. |
S[] |
getStates()
Obtains the valid states defined by the
Model. |
Iterable<Transition<S>> |
getTransitions()
Obtains the
Transitions defined by the Model. |
public SimpleModel(Class<S> stateClass)
SimpleModel given an Enum of the possible states of a FiniteStateMachine.stateClass - the Enum class containing the possible statespublic Map<S,StateEntryAction<S>> getStateEntryActions()
StateEntryActions defined for the states in the Model.getStateEntryActions in interface Model<S extends Enum<S>>StateEntryActions defined for the states in the Modelpublic void addStateEntryAction(S state, StateEntryAction<S> stateEntryAction)
StateEntryAction for the specified state in the Model.state - the statestateEntryAction - the StateEntryAction for the statepublic Map<S,StateExitAction<S>> getStateExitActions()
StateExitActions defined for the states in the Model.getStateExitActions in interface Model<S extends Enum<S>>StateExitActions defined for the states in the Modelpublic Iterable<Transition<S>> getTransitions()
Transitions defined by the Model.getTransitions in interface Model<S extends Enum<S>>Transitions defined by the Modelpublic S getState(String sName)
SimpleModel.sName - the name of the state to obtainnull if no such state is known by the SimpleModelpublic void addStateExitAction(S state, StateExitAction<S> stateExitAction)
StateExitAction for the specified state in the Model.state - the statestateExitAction - the StateExitAction for the statepublic void addTransition(Transition<S> transition)
Transition to the Model.transition - the Transition to add