Class ExtendedIntervalIterator


  • class ExtendedIntervalIterator
    extends IntervalIterator
    Wraps an IntervalIterator and extends the bounds of its intervals Useful for specifying gaps in an ordered iterator; if you want to match `a b [2 spaces] c`, you can search for phrase(a, extended(b, 0, 2), c) An interval with prefix bounds extended by n will skip over matches that appear in positions lower than n
    • Field Detail

      • before

        private final int before
      • after

        private final int after
      • positioned

        private boolean positioned
    • Constructor Detail

      • ExtendedIntervalIterator

        ExtendedIntervalIterator​(IntervalIterator in,
                                 int before,
                                 int after)
        Create a new ExtendedIntervalIterator
        Parameters:
        in - the iterator to wrap
        before - the number of positions to extend before the delegated interval
        after - the number of positions to extend beyond the delegated interval