K
- the enum used to identify statesE
- the enum used to identify eventspublic class StateTransition<K,E>
extends java.lang.Object
Constructor and Description |
---|
StateTransition(K source,
K destination,
E trigger) |
Modifier and Type | Method and Description |
---|---|
boolean |
canTrigger(E eventID,
java.lang.Object context)
Checks if this transition can be triggered.
|
K |
getDestination() |
K |
getSource() |
void |
transitionAction(java.lang.Object context)
Performs the transition part of a state change (but not the state change
itself)
|
public K getSource()
public K getDestination()
public boolean canTrigger(E eventID, java.lang.Object context)
eventID
- the event that triggered checkingcontext
- the object that triggered the eventpublic void transitionAction(java.lang.Object context)
context
- the object that triggered the event