public class PagingIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
If you have access to Collection 4.1, it is recommended to use
IteratorUtils#boundedIterator(Iterator, long, long)
instead.
Constructor and Description |
---|
PagingIterator(java.util.Iterator<E> it,
java.lang.Integer offset,
java.lang.Integer limit)
Instantiates a new paging wrapper of the given iterator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
E |
next() |
void |
remove() |
public PagingIterator(@Nonnull java.util.Iterator<E> it, @CheckForNull java.lang.Integer offset, @CheckForNull java.lang.Integer limit) throws java.lang.IllegalArgumentException
The iterator is iterated immediately as per offset
.
it
- The iterator to wrapoffset
- The offset of the paging; null
to do paging without
offset.limit
- The limit of the paging; null
to do paging without limit.java.lang.IllegalArgumentException
- When either offset or limit is negativeCopyright © 2010 - 2020 Adobe. All Rights Reserved