Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Class PagedIterator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.PagedIterator

All Implemented Interfaces:
java.util.Iterator

public class PagedIterator
extends Base
implements java.util.Iterator

PagedIterator is an Iterator implementation based on a concept of a page Advancer - a pluggable component that knows how to supply a next page of objects to iterate through. As common to iterators, this implementation is not thread safe.

Since:
Coherence 3.4
Author:
gg 2008.01.25

Nested Class Summary
static interface PagedIterator.Advancer
          Advancer is a pluggable component that knows how to load a new page (Collection) of objects to be used by the enclosing PagedIterator.

 

Field Summary
protected  PagedIterator.Advancer m_advancer
          The underlying Advancer.
protected  java.util.Iterator m_iterPage
          An Iterator for the current page.
protected  java.lang.Object m_oCurr
          Currently "Active" object.

 

Constructor Summary
PagedIterator(PagedIterator.Advancer advancer)
          Construct a PagedIterator based on the specified Advancer.

 

Method Summary
 boolean hasNext()
          Check whether or not the iterator has more elements.
 java.lang.Object next()
          Return the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by the iterator.

 

Field Detail

m_advancer

protected PagedIterator.Advancer m_advancer
The underlying Advancer.

m_iterPage

protected java.util.Iterator m_iterPage
An Iterator for the current page.

m_oCurr

protected java.lang.Object m_oCurr
Currently "Active" object.

Constructor Detail

PagedIterator

public PagedIterator(PagedIterator.Advancer advancer)
Construct a PagedIterator based on the specified Advancer.
Parameters:
advancer - the underlying Advancer

Method Detail

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator. Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
Specified by:
remove in interface java.util.Iterator

hasNext

public boolean hasNext()
Check whether or not the iterator has more elements. Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
Return the next element in the iteration. Returns the next element in the iteration. Calling this method repeatedly until the Iterator.hasNext() method returns false will return each element in the underlying collection exactly once.
Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration.

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.