Class RunAutomaton

  • All Implemented Interfaces:
    Direct Known Subclasses:
    ByteRunAutomaton, CharacterRunAutomaton

    public abstract class RunAutomaton
    extends Object
    implements Accountable
    Finite-state automaton with fast run operation. The initial state is always 0.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • RunAutomaton

        protected RunAutomaton​(Automaton a,
                               int alphabetSize)
        Constructs a new RunAutomaton from a deterministic Automaton.
        a - an automaton
      • RunAutomaton

        protected RunAutomaton​(Automaton a,
                               int alphabetSize,
                               int determinizeWorkLimit)
        Constructs a new RunAutomaton from a deterministic Automaton.
        a - an automaton
        determinizeWorkLimit - maximum effort to spend while determinizing
    • Method Detail

      • toString

        public String toString()
        Returns a string representation of this automaton.
        toString in class Object
      • getSize

        public final int getSize()
        Returns number of states in automaton.
      • isAccept

        public final boolean isAccept​(int state)
        Returns acceptance status for given state.
      • getCharIntervals

        public final int[] getCharIntervals()
        Returns array of codepoint class interval start points. The array should not be modified by the caller.
      • step

        public final int step​(int state,
                              int c)
        Returns the state obtained by reading the given char from the given state. Returns -1 if not obtaining any such state. (If the original Automaton had no dead states, -1 is returned here if and only if a dead state is entered in an equivalent automaton with a total transition function.)
      • hashCode

        public int hashCode()
        hashCode in class Object
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable