Class State<T>

  • Type Parameters:
    T - kind of states

    public class State<T>
    extends java.lang.Object

    Copyright: Copyright (c) 2006

    Company: Clark & Parsia, LLC.

    Author:
    Evren Sirin
    • Constructor Summary

      Constructors 
      Constructor Description
      State()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTransition​(State<T> s)
      Create an epsilon transition from this state to the given state
      void addTransition​(T symbol, State<T> s)
      Create a transition from this state to the given state on given symbol
      int getName()  
      java.util.Set<Transition<T>> getTransitions()
      Returns the _transitions for originating from this state.
      State<T> move​(T symbol)
      Returns a state reached from this state with the given symbol.
      void setName​(int i)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • State

        public State()
    • Method Detail

      • addTransition

        public void addTransition​(T symbol,
                                  State<T> s)
        Create a transition from this state to the given state on given symbol
        Parameters:
        symbol -
        s -
      • addTransition

        public void addTransition​(State<T> s)
        Create an epsilon transition from this state to the given state
        Parameters:
        s -
      • getTransitions

        public java.util.Set<Transition<T>> getTransitions()
        Returns the _transitions for originating from this state.
        Returns:
        the _transitions for originating from this state
      • move

        public State<T> move​(T symbol)
        Returns a state reached from this state with the given symbol. If more than one state can be reached with the given symbol, an arbitrary one is returned.
        Parameters:
        symbol -
        Returns:
        a state reached from this state with the given symbol, null otherwise
      • getName

        public int getName()
      • setName

        public void setName​(int i)
      • toString

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