Class PagedIterator<T>

  • Type Parameters:
    T - the type parameter
    All Implemented Interfaces:
    Iterator<T>

    public abstract class PagedIterator<T>
    extends Object
    implements Iterator<T>
    Iterator over a paginated data source.

    Aside from the normal iterator operation, this method exposes nextPage() that allows the caller to retrieve items per page.

    Author:
    Kohsuke Kawaguchi
    • Method Detail

      • wrapUp

        protected abstract void wrapUp​(T[] page)
        Wrap up.
        Parameters:
        page - the page
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<T>
      • nextPage

        public List<T> nextPage()
        Gets the next page worth of data.
        Returns:
        the list