Package event

Class State

java.lang.Object
event.State

public abstract class State extends Object
Defines the abstract state of a Deterministic Finite State Automaton (DFSA). It is recommended that the set of states defining a DFSA are defined as static classes within a container class for proper encapsulation.
Author:
Krish Pillai
See Also:
  • Constructor Details

    • State

      public State(String name)
      State constructor takes a label. The label is used for checking congruence of state objects.
      Parameters:
      name - String defining the name of the state e.g. {S0, S1, S2, ...}
  • Method Details

    • manage

      public abstract void manage()
      The method that will be invoked when a state change occurs. This method should be overridden by the concrete state class.
    • toString

      public String toString()
      String representation of the State. Only the name field is considered.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getDescription

      public String getDescription()
      Returns commentary describing this state.
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Commentary describing this state.
      Parameters:
      description -