Class BoundedIterator<T>
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.iterator.BoundedIterator<T>
-
-
Constructor Summary
Constructors Constructor Description BoundedIterator(long offset, long max, Iterator<T> iterator)
Create a new bounded iterator with a given offset and maximum
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Iterator<T>
create(long offset, long max, Iterator<T> iterator)
Factory for creating a bounded iterator.boolean
hasNext()
T
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
BoundedIterator
public BoundedIterator(long offset, long max, Iterator<T> iterator)
Create a new bounded iterator with a given offset and maximum- Parameters:
offset
- offset to start iteration at. Must be non negativemax
- maximum elements this iterator should return. Set to -1 for alliterator
- the underlying iterator- Throws:
IllegalArgumentException
- if offset is negative
-
-
Method Detail
-
create
public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator)
Factory for creating a bounded iterator.- Type Parameters:
T
- element type- Parameters:
offset
- offset to start iteration at. Must be non negativemax
- maximum elements this iterator should return. Set to -1 for alliterator
- the underlying iterator- Returns:
- an iterator which only returns the elements in the given bounds
- See Also:
BoundedIterator(long, long, java.util.Iterator)
-
-