Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.pagination
Class PagedResultIterator<T>

    java.lang.Object
      com.bea.p13n.pagination.PagedResultIterator<T>

All Implemented Interfaces
  Iterable<T>, Iterator<T>

    public class PagedResultIterator<T>

extends Object
implements Iterator<T>, Iterable<T>

A wrapper around a PagedResult to iterate over the entire contents. This allows the PagedResult to retrieve data in pages (more efficient, usually), while providing a more convenient way to iterate the entire set of results, as this iterator handles the page boundaries for you.

Rules for use:

- Do not resize, resort, refilter, or othersise interact with the PagedResult while iterating via this iterator.
- The paged result is expected to be positioned before the first page (in its initial, resized, resorted, or refiltered condition) when this object is constructed.
- It is still your responsibility to close the PagedResult when you are finished using it.

Constructor Summary
`PagedResultIterator(PagedResult<T> pagedResult)` Construct an iterator around a paged result

Method Summary
`boolean` | `hasNext()`
`Iterator<T>` | `iterator()` Return self so that this iterator can also be Iterable
`T` | `next()` Return the next item - either on the current page or by skipping to the next page.
`void` | `remove()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PagedResultIterator

    public PagedResultIterator(PagedResult<T> pagedResult)

  Construct an iterator around a paged result

  Parameters
    `pagedResult` - The PagedResult to iterate

Method Detail

### hasNext

    public boolean hasNext()

  Specified by:
    `hasNext` in interface `Iterator<T>`

### next

    public T next()

  Return the next item - either on the current page or by skipping to the next page.

  Specified by:
    `next` in interface `Iterator<T>`

### remove

    public void remove()

  Specified by:
    `remove` in interface `Iterator<T>`
  Throws
    `UnsupportedOperationException` - always

### iterator

    public Iterator<T> iterator()

  Return self so that this iterator can also be Iterable

  Specified by:
    `iterator` in interface `Iterable<T>`
  Returns
    this

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.