Class RunAutomaton

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RunAutomaton​(Automaton a, int alphabetSize)
      Constructs a new RunAutomaton from a deterministic Automaton.
      protected RunAutomaton​(Automaton a, int alphabetSize, int determinizeWorkLimit)
      Constructs a new RunAutomaton from a deterministic Automaton.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      (package private) int getCharClass​(int c)
      Gets character class of given codepoint
      int[] getCharIntervals()
      Returns array of codepoint class interval start points.
      int getSize()
      Returns number of states in automaton.
      int hashCode()  
      boolean isAccept​(int state)
      Returns acceptance status for given state.
      long ramBytesUsed()
      Return the memory usage of this object in bytes.
      int step​(int state, int c)
      Returns the state obtained by reading the given char from the given state.
      java.lang.String toString()
      Returns a string representation of this automaton.
      • Methods inherited from class java.lang.Object

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

      • BASE_RAM_BYTES

        private static final long BASE_RAM_BYTES
      • alphabetSize

        final int alphabetSize
      • size

        final int size
      • transitions

        final int[] transitions
      • points

        final int[] points
      • classmap

        final int[] classmap
    • Constructor Detail

      • RunAutomaton

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

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

      • toString

        public java.lang.String toString()
        Returns a string representation of this automaton.
        Overrides:
        toString in class java.lang.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.
      • getCharClass

        final int getCharClass​(int c)
        Gets character class of given codepoint
      • 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()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.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