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

Package org.apache.lucene.util.automaton

# Class FiniteStringsIterator

java.lang.Object
org.apache.lucene.util.automaton.FiniteStringsIterator

Direct Known Subclasses:
  `LimitedFiniteStringsIterator`

public class FiniteStringsIterator extends Object
Iterates all accepted strings.

If the `Automaton` has cycles then this iterator may throw an `IllegalArgumentException`, but this is not guaranteed!

Be aware that the iteration order is implementation dependent and may change across releases.

If the automaton is not determinized then it's possible this iterator will return duplicates.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FiniteStringsIterator(Automaton a)`
  Constructor.
  `FiniteStringsIterator(Automaton a, int startState, int endState)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IntsRef`
  `next()`
  Generate next finite string.

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FiniteStringsIterator

    public FiniteStringsIterator(Automaton a)
    Constructor.
    Parameters:
      `a` - Automaton to create finite string from.

  - ### FiniteStringsIterator

    public FiniteStringsIterator(Automaton a, int startState, int endState)
    Constructor.
    Parameters:
      `a` - Automaton to create finite string from.
      `startState` - The starting state for each path.
      `endState` - The state where each path should stop or -1 if only accepted states should be final.

- ## Method Details

  - ### next

    public IntsRef next()
    Generate next finite string. The return value is just valid until the next call of this method!
    Returns:
      Finite string or null, if no more finite strings are available.