Package event

Class StateChangeEvent

java.lang.Object
event.StateChangeEvent

public class StateChangeEvent extends Object
Describes an event that denotes a change of state. It contains references to the old state, the new state, and the FSM (source) that facilitated the transition.
  • Constructor Details

    • StateChangeEvent

      public StateChangeEvent(FSM source, State oldState, State newState)
      Representation of a state change,
      Parameters:
      source - The FSM involved
      oldState - The state transitioned out of.
      newState - The state transitioned into.
  • Method Details

    • getSource

      public FSM getSource()
      Returns the FSM (source) that experienced the state change
      Returns:
      the source
    • getOldState

      public State getOldState()
      The state the FSM transitioned out of.
      Returns:
      the oldState
    • getNewState

      public State getNewState()
      The new state that the FSM transitioned into.
      Returns:
      the newState