Class StringsToAutomaton.State

java.lang.Object
org.apache.lucene.util.automaton.StringsToAutomaton.State
Enclosing class:
StringsToAutomaton

private static final class StringsToAutomaton.State extends Object
DFSA state with char labels on transitions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) boolean
    true if this state corresponds to the end of at least one input sequence.
    (package private) int[]
    Labels of outgoing transitions.
    private static final int[]
    An empty set of labels.
    private static final StringsToAutomaton.State[]
    An empty set of states.
    (package private) StringsToAutomaton.State[]
    States reachable from outgoing transitions.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Two states are equal if: they have an identical number of outgoing transitions, labeled with the same labels corresponding outgoing transitions lead to the same states (to states with an identical right-language).
    (package private) StringsToAutomaton.State
    getState(int label)
    Returns the target state of a transition leaving this state and labeled with label .
    (package private) boolean
    Return true if this state has any children (outgoing transitions).
    int
    Compute the hash code of the current status of this state.
    (package private) StringsToAutomaton.State
    Return the most recent transitions's target state.
    (package private) StringsToAutomaton.State
    lastChild(int label)
    Return the associated state if the most recent transition is labeled with label.
    (package private) StringsToAutomaton.State
    newState(int label)
    Create a new outgoing transition labeled label and return the newly created target state for this transition.
    private static boolean
    Compare two lists of objects for reference-equality.
    (package private) void
    Replace the last added outgoing transition's target state with the given state.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_LABELS

      private static final int[] NO_LABELS
      An empty set of labels.
    • NO_STATES

      private static final StringsToAutomaton.State[] NO_STATES
      An empty set of states.
    • labels

      int[] labels
      Labels of outgoing transitions. Indexed identically to states. Labels must be sorted lexicographically.
    • states

      States reachable from outgoing transitions. Indexed identically to labels.
    • is_final

      boolean is_final
      true if this state corresponds to the end of at least one input sequence.
  • Constructor Details

    • State

      private State()
  • Method Details

    • getState

      StringsToAutomaton.State getState(int label)
      Returns the target state of a transition leaving this state and labeled with label . If no such transition exists, returns null.
    • equals

      public boolean equals(Object obj)
      Two states are equal if:
      • they have an identical number of outgoing transitions, labeled with the same labels
      • corresponding outgoing transitions lead to the same states (to states with an identical right-language).
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Compute the hash code of the current status of this state.
      Overrides:
      hashCode in class Object
    • hasChildren

      boolean hasChildren()
      Return true if this state has any children (outgoing transitions).
    • newState

      StringsToAutomaton.State newState(int label)
      Create a new outgoing transition labeled label and return the newly created target state for this transition.
    • lastChild

      Return the most recent transitions's target state.
    • lastChild

      StringsToAutomaton.State lastChild(int label)
      Return the associated state if the most recent transition is labeled with label.
    • replaceLastChild

      void replaceLastChild(StringsToAutomaton.State state)
      Replace the last added outgoing transition's target state with the given state.
    • referenceEquals

      private static boolean referenceEquals(Object[] a1, Object[] a2)
      Compare two lists of objects for reference-equality.