Package org.kohsuke.github
Class PagedIterator<T>
- java.lang.Object
-
- org.kohsuke.github.PagedIterator<T>
-
- Type Parameters:
T- the type parameter
- All Implemented Interfaces:
Iterator<T>
public class PagedIterator<T> extends Object implements Iterator<T>
Iterator over a paginated data source. Iterates of the content items of each page, automatically requesting new pages as needed.Aside from the normal iterator operation, this method exposes
nextPage()andnextPageArray()that allows the caller to retrieve entire pages. This class is not thread-safe. Any one instance should only be called from a single thread.- Author:
- Kohsuke Kawaguchi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tnext()List<T>nextPage()Gets the next page worth of data.protected voidwrapUp(T[] page)This poorly named method, initializes items with local data after they are fetched.-
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, remove
-
-
-
-
Method Detail
-
wrapUp
protected void wrapUp(T[] page)
This poorly named method, initializes items with local data after they are fetched. It is up to the implementer to decide what local data to apply.- Parameters:
page- the page of items to be initialized
-
-