org.apache.lucene.util.automaton

## Class RunAutomaton

- java.lang.Object
- - org.apache.lucene.util.automaton.RunAutomaton

- Direct Known Subclasses:
    ByteRunAutomaton, CharacterRunAutomaton

      public abstract class RunAutomaton
      extends Object

  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 Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RunAutomaton(Automaton a, int alphabetSize)` Constructs a new `RunAutomaton` from a deterministic `Automaton`.
    `protected` | `RunAutomaton(Automaton a, int alphabetSize, int maxDeterminizedStates)` Constructs a new `RunAutomaton` from a deterministic `Automaton`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `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.
    `int` | `step(int state, int c)` Returns the state obtained by reading the given char from the given state.
    `String` | `toString()` Returns a string representation of this automaton.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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 maxDeterminizedStates)

      Constructs a new `RunAutomaton` from a deterministic `Automaton`.
      Parameters:
        `a` - an automaton
        `maxDeterminizedStates` - maximum number of states that can be created while determinizing a

  - ### Method Detail

    - #### toString

          public String toString()

      Returns a string representation of this automaton.
      Overrides:
        `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()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.