org.apache.chemistry.opencmis.client.runtime.util
Class AbstractIterator<T>

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator<T>
Type Parameters:
T - the type returned by the iterator
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
CollectionIterator, CollectionPageIterator

public abstract class AbstractIterator<T>
extends Object
implements Iterator<T>

Abstract Iterator implementation.


Constructor Summary
protected AbstractIterator(long skipCount, AbstractPageFetcher<T> pageFetcher)
          Construct
 
Method Summary
protected  AbstractPageFetcher.Page<T> getCurrentPage()
          Gets the current page of items within collection
 boolean getHasMoreItems()
           
 long getPageNumItems()
           
 long getPosition()
           
protected  long getSkipCount()
          Gets current skip count
protected  int getSkipOffset()
          Gets current skip offset (from skip count)
 long getTotalNumItems()
           
protected  AbstractPageFetcher.Page<T> incrementPage()
          Skip to the next page of items within collection
protected  int incrementSkipOffset()
          Increment the skip offset by one
 void remove()
           
 
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
hasNext, next
 

Constructor Detail

AbstractIterator

protected AbstractIterator(long skipCount,
                           AbstractPageFetcher<T> pageFetcher)
Construct

Parameters:
skipCount -
pageFetcher -
Method Detail

getPosition

public long getPosition()

getPageNumItems

public long getPageNumItems()

getTotalNumItems

public long getTotalNumItems()

getHasMoreItems

public boolean getHasMoreItems()

remove

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

getSkipCount

protected long getSkipCount()
Gets current skip count

Returns:
skip count

getSkipOffset

protected int getSkipOffset()
Gets current skip offset (from skip count)

Returns:
skip offset

incrementSkipOffset

protected int incrementSkipOffset()
Increment the skip offset by one

Returns:
incremented skip offset

getCurrentPage

protected AbstractPageFetcher.Page<T> getCurrentPage()
Gets the current page of items within collection

Returns:
current page

incrementPage

protected AbstractPageFetcher.Page<T> incrementPage()
Skip to the next page of items within collection

Returns:
next page


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.