Package event
Class State
java.lang.Object
event.State
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns commentary describing this state.inthashCode()abstract voidmanage()The method that will be invoked when a state change occurs.voidsetDescription(String description) Commentary describing this state.toString()String representation of the State.
-
Constructor Details
-
State
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
String representation of the State. Only the name field is considered. -
hashCode
public int hashCode() -
equals
-
getDescription
Returns commentary describing this state.- Returns:
- the description
-
setDescription
Commentary describing this state.- Parameters:
description-
-