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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int count
      Number of generated finite strings.
      private int limit
      Maximum number of finite strings to create.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IntsRef next()
      Generate next finite string.
      int size()
      Number of iterated finite strings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • limit

        private int limit
        Maximum number of finite strings to create.
      • count

        private int count
        Number of generated finite strings.
    • 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.