ByteRunnable (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util.automaton, interface: ByteRunnable

Package org.apache.lucene.util.automaton

# Interface ByteRunnable

All Known Implementing Classes:
  `ByteRunAutomaton`, `NFARunAutomaton`

public interface ByteRunnable
A runnable automaton accepting byte array as input

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getSize()`
  Returns number of states this automaton has, note this may not be an accurate number in case of NFA
  `boolean`
  `isAccept(int state)`
  Returns acceptance status for given state.
  `default boolean`
  `run(byte[] s, int offset, int length)`
  Returns true if the given byte array is accepted by this automaton
  `int`
  `step(int state, int c)`
  Returns the state obtained by reading the given char from the given state.

- ## Method Details

  - ### step

    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.
    Parameters:
      `state` - the last state
      `c` - the input codepoint
    Returns:
      the next state, -1 if no such transaction

  - ### isAccept

    boolean isAccept(int state)
    Returns acceptance status for given state.
    Parameters:
      `state` - the state
    Returns:
      whether the state is accepted

  - ### getSize

    int getSize()
    Returns number of states this automaton has, note this may not be an accurate number in case of NFA
    Returns:
      number of states

  - ### run

    default boolean run(byte[] s, int offset, int length)
    Returns true if the given byte array is accepted by this automaton