Class Operation.ForceProgressIterator

  • All Implemented Interfaces:
    IntIterator
    Enclosing class:
    Operation

    protected static class Operation.ForceProgressIterator
    extends java.lang.Object
    implements IntIterator
    The ForceProgressIterator is used to protect against non-termination; specifically, iterators that return an infinite number of zero-length matches. After getting a certain number of zero-length matches at the same position, hasNext() returns false. (Potentially this gives problems with an expression such as (a?|b?|c?|d) that can legitimately return more than one zero-length match).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Test whether there are any more integers in the sequence; and change the state of the iterator so a call on IntIterator.next() delivers the next integer.
      int next()
      Return the next integer in the sequence.
      • Methods inherited from class java.lang.Object

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

      • hasNext

        public boolean hasNext()
        Description copied from interface: IntIterator
        Test whether there are any more integers in the sequence; and change the state of the iterator so a call on IntIterator.next() delivers the next integer.

        The effect of calling #hasNext() a second time without an intervening call on #next() is undefined.

        Specified by:
        hasNext in interface IntIterator
        Returns:
        true if there are more integers to come
      • next

        public int next()
        Description copied from interface: IntIterator
        Return the next integer in the sequence. The result is undefined unless #hasNext() has been called and has returned true.
        Specified by:
        next in interface IntIterator
        Returns:
        the next integer in the sequence