Package org.apache.lucene.util.automaton
Class LimitedFiniteStringsIterator
java.lang.Object
org.apache.lucene.util.automaton.FiniteStringsIterator
org.apache.lucene.util.automaton.LimitedFiniteStringsIterator
FiniteStringsIterator
which limits the number of iterated accepted strings. If more than
limit
strings are accepted, the first limit
strings found are returned.
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.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
LimitedFiniteStringsIterator
Constructor.- Parameters:
a
- Automaton to create finite string from.limit
- Maximum number of finite strings to create, or -1 for infinite.
-
-
Method Details
-
next
Description copied from class:FiniteStringsIterator
Generate next finite string. The return value is just valid until the next call of this method!- Overrides:
next
in classFiniteStringsIterator
- Returns:
- Finite string or null, if no more finite strings are available.
-
size
public int size()Number of iterated finite strings.
-