public class FSMImp extends Object implements FSM
| Constructor and Description |
|---|
FSMImp(Object eventsource,
TxState initialstate)
Creates a new instance with a given event source.
|
FSMImp(TxState initialstate)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFSMEnterListener(FSMEnterListener lstnr,
TxState state)
Add an enter event listener.
|
void |
addFSMTransitionListener(FSMTransitionListener listener,
TxState from,
TxState to) |
TxState |
getState() |
protected void |
notifyListeners(Transition transition,
boolean pre)
Notify transition listeners.
|
protected void |
notifyListeners(TxState state,
boolean pre)
Notify the enter listeners.
|
void |
setState(TxState state) |
public FSMImp(TxState initialstate)
transitiontable - The transitiontable with valid
transitions.initialstate - The initial state of the FSM.public FSMImp(Object eventsource, TxState initialstate)
eventsource - The object to be used as source of events.transitiontable - The transitiontable for state changes.initialstate - The initial state of the FSM.protected void notifyListeners(TxState state, boolean pre)
state - The state about to enter (or entered).pre - True iff before entering.protected void notifyListeners(Transition transition, boolean pre)
transition - pre - True iff before transition.public TxState getState()
public void setState(TxState state) throws IllegalStateException
setState in interface StateMutableIllegalStateException - if the new state transition to
the new state is not allowed.StateMutablepublic void addFSMEnterListener(FSMEnterListener lstnr, TxState state)
FSMEnterEventSourceaddFSMEnterListener in interface FSMEnterEventSourcelstnr - The listener.state - The state to listen on.FSMEnterEventSourcepublic void addFSMTransitionListener(FSMTransitionListener listener, TxState from, TxState to)
addFSMTransitionListener in interface FSMTransitionEventSourceFSMTransitionEventSourceCopyright © 2023. All rights reserved.