Class LimitedFiniteStringsIterator


  • public class LimitedFiniteStringsIterator
    extends FiniteStringsIterator
    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 Detail

      • LimitedFiniteStringsIterator

        public LimitedFiniteStringsIterator​(Automaton a,
                                            int limit)
        Constructor.
        Parameters:
        a - Automaton to create finite string from.
        limit - Maximum number of finite strings to create, or -1 for infinite.
    • Method Detail

      • next

        public IntsRef 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 class FiniteStringsIterator
        Returns:
        Finite string or null, if no more finite strings are available.
      • size

        public int size()
        Number of iterated finite strings.