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

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.runtime.util.AbstractIterable<T>
Type Parameters:
T - the type returned by the iterable's iterator
All Implemented Interfaces:
java.lang.Iterable<T>, ItemIterable<T>
Direct Known Subclasses:
CollectionIterable, CollectionPageIterable

public abstract class AbstractIterable<T>
extends java.lang.Object
implements ItemIterable<T>

Abstract ItemIterable implementation.


Constructor Summary
protected AbstractIterable(AbstractPageFetcher<T> pageFetcher)
           
protected AbstractIterable(long position, AbstractPageFetcher<T> pageFetcher)
           
 
Method Summary
protected abstract  AbstractIterator<T> createIterator()
          Construct the iterator
 boolean getHasMoreItems()
          Returns whether the repository contains additional items beyond the page of items already fetched.
 ItemIterable<T> getPage()
          Gets an iterable for the current sub collection within the CMIS collection using default maximum number of items
 ItemIterable<T> getPage(int maxNumItems)
          Gets an iterable for the current sub collection within the CMIS collection
protected  AbstractPageFetcher<T> getPageFetcher()
          Gets the page fetcher
 long getPageNumItems()
          Returns the number of items fetched for the current page.
protected  long getSkipCount()
          Gets the skip count
 long getTotalNumItems()
          Returns the total number of items.
 AbstractIterator<T> iterator()
           
 ItemIterable<T> skipTo(long position)
          Skip to position within CMIS collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIterable

protected AbstractIterable(AbstractPageFetcher<T> pageFetcher)

AbstractIterable

protected AbstractIterable(long position,
                           AbstractPageFetcher<T> pageFetcher)
Method Detail

getSkipCount

protected long getSkipCount()
Gets the skip count

Returns:
skip count

getPageFetcher

protected AbstractPageFetcher<T> getPageFetcher()
Gets the page fetcher

Returns:
page fetcher

createIterator

protected abstract AbstractIterator<T> createIterator()
Construct the iterator

Returns:
iterator

iterator

public AbstractIterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>
Specified by:
iterator in interface ItemIterable<T>

skipTo

public ItemIterable<T> skipTo(long position)
Description copied from interface: ItemIterable
Skip to position within CMIS collection

Specified by:
skipTo in interface ItemIterable<T>
Returns:
iterable whose starting point is the specified skip to position. This iterable may be the same as this

getPage

public ItemIterable<T> getPage()
Description copied from interface: ItemIterable
Gets an iterable for the current sub collection within the CMIS collection using default maximum number of items

Specified by:
getPage in interface ItemIterable<T>
Returns:
iterable for current page

getPage

public ItemIterable<T> getPage(int maxNumItems)
Description copied from interface: ItemIterable
Gets an iterable for the current sub collection within the CMIS collection

Specified by:
getPage in interface ItemIterable<T>
Parameters:
maxNumItems - maximum number of items the sub collection will contain
Returns:
iterable for current page

getPageNumItems

public long getPageNumItems()
Description copied from interface: ItemIterable
Returns the number of items fetched for the current page.

Specified by:
getPageNumItems in interface ItemIterable<T>
Returns:
number of items for currently fetched collection

getHasMoreItems

public boolean getHasMoreItems()
Description copied from interface: ItemIterable
Returns whether the repository contains additional items beyond the page of items already fetched.

Specified by:
getHasMoreItems in interface ItemIterable<T>
Returns:
true => further page requests will be made to the repository

getTotalNumItems

public long getTotalNumItems()
Description copied from interface: ItemIterable
Returns the total number of items. If the repository knows the total number of items in a result set, the repository SHOULD include the number here. If the repository does not know the number of items in a result set, this parameter SHOULD not be set. The value in the parameter MAY NOT be accurate the next time the client retrieves the result set or the next page in the result set.

Specified by:
getTotalNumItems in interface ItemIterable<T>
Returns:
total number of items or (-1)


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