@Override public List<E> next() { if (!this.hasNext()) { throw new NoSuchElementException("There are no more pages to iterate over"); } List<E> itemsInPage = target.getPage(currentPage + 1); currentPage++; currentListCount += pageSize; return itemsInPage; }
PagedListIterator(final PagedList<E> target) { this.target = target; size = target.getSize(); pageSize = target.getPageSize(); }