Package com.adobe.granite.ui.components
Class PagingIterator<E>
- java.lang.Object
-
- com.adobe.granite.ui.components.PagingIterator<E>
-
- All Implemented Interfaces:
java.util.Iterator<E>
public class PagingIterator<E> extends java.lang.Object implements java.util.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
Constructors Constructor Description PagingIterator(java.util.Iterator<E> it, java.lang.Integer offset, java.lang.Integer limit)Instantiates a new paging wrapper of the given iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Enext()voidremove()
-
-
-
Constructor Detail
-
PagingIterator
public PagingIterator(@Nonnull java.util.Iterator<E> it, @CheckForNull java.lang.Integer offset, @CheckForNull java.lang.Integer limit) throws java.lang.IllegalArgumentExceptionInstantiates 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:
java.lang.IllegalArgumentException- When either offset or limit is negative
-
-