Class State

  • All Implemented Interfaces:
    java.lang.Comparable<State>

    public final class State
    extends java.lang.Object
    implements java.lang.Comparable<State>
    A class that describes an Automaton state.
    • Constructor Summary

      Constructors 
      Constructor Description
      State​(int id, boolean isInitial, boolean isFinal)
      State constructor, it creates a new state with the given information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(State state)  
      boolean equals​(java.lang.Object obj)  
      int getId()
      Returns the states, id.
      java.lang.String getState()
      Yields a textual representation of this state.
      int hashCode()  
      boolean isFinal()
      Tells if the state is either final or not.
      boolean isInitial()
      Tells if the state is either initial or not.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • State

        public State​(int id,
                     boolean isInitial,
                     boolean isFinal)
        State constructor, it creates a new state with the given information.
        Parameters:
        id - the id of this state
        isInitial - indicates if the state is initial.
        isFinal - indicates if the state is final.
    • Method Detail

      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isFinal

        public boolean isFinal()
        Tells if the state is either final or not.
        Returns:
        boolean value that indicates if it is a final state.
      • isInitial

        public boolean isInitial()
        Tells if the state is either initial or not.
        Returns:
        boolean value that indicates if it is an initial state
      • getId

        public int getId()
        Returns the states, id.
        Returns:
        integer value representing the state's id.
      • compareTo

        public int compareTo​(State state)
        Specified by:
        compareTo in interface java.lang.Comparable<State>
      • getState

        public java.lang.String getState()
        Yields a textual representation of this state.
        Returns:
        the textual representation