Package com.adobe.granite.ui.components
Class PagingIterator<E>
java.lang.Object
com.adobe.granite.ui.components.PagingIterator<E>
- All Implemented Interfaces:
Iterator<E>
A wrapper iterator to supports paging.
If you have access to Collection 4.1, it is recommended to use
IteratorUtils#boundedIterator(Iterator, long, long) instead.
-
Constructor Summary
ConstructorsConstructorDescriptionPagingIterator(Iterator<E> it, Integer offset, Integer limit) Instantiates a new paging wrapper of the given iterator. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
PagingIterator
public PagingIterator(@Nonnull Iterator<E> it, @CheckForNull Integer offset, @CheckForNull Integer limit) throws IllegalArgumentException Instantiates a new paging wrapper of the given iterator.The iterator is iterated immediately as per
offset.- Parameters:
it- The iterator to wrapoffset- The offset of the paging;nullto do paging without offset.limit- The limit of the paging;nullto do paging without limit.- Throws:
IllegalArgumentException- When either offset or limit is negative
-
-
Method Details