Class Transition<T extends TransitionSymbol<T>>

  • Type Parameters:
    T - the concrete type of TransitionSymbols that the transition recognizes
    All Implemented Interfaces:
    java.lang.Comparable<Transition<T>>

    public final class Transition<T extends TransitionSymbol<T>>
    extends java.lang.Object
    implements java.lang.Comparable<Transition<T>>
    A class that describes an Automaton transition.
    • Constructor Detail

      • Transition

        public Transition​(State source,
                          State destination,
                          T symbol)
        Creates a new transition for a generic automaton.
        Parameters:
        source - state from which the transition could be applied.
        destination - state reached after the transition execution.
        symbol - the character that have to be read to execute the transition.
    • 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
      • isEpsilonTransition

        public boolean isEpsilonTransition()
        Yields true if and only if this transition recognizes only the empty string.
        Returns:
        true if and only if that condition holds
      • getSource

        public State getSource()
        Tells transition's source state.
        Returns:
        source of this transition.
      • getSymbol

        public T getSymbol()
        Tells input symbol for this transition.
        Returns:
        symbol needed to execute this transition.
      • getDestination

        public State getDestination()
        Tells transition's destination state.
        Returns:
        destination of this transition.
      • compareTo

        public int compareTo​(Transition<T> transition)
        Specified by:
        compareTo in interface java.lang.Comparable<T extends TransitionSymbol<T>>