org.hippoecm.hst.content.beans.standard
Class HippoBeanIteratorImpl

java.lang.Object
  extended by org.hippoecm.hst.content.beans.standard.HippoBeanIteratorImpl
All Implemented Interfaces:
Iterator<HippoBean>, HippoBeanIterator

public class HippoBeanIteratorImpl
extends Object
implements HippoBeanIterator


Constructor Summary
HippoBeanIteratorImpl(ObjectConverter objectConverter, javax.jcr.NodeIterator nodeIterator, HstVirtualizer virtualizer)
           
 
Method Summary
 long getPosition()
          Returns the current position within the iterator.
 long getSize()
          Returns the number of elements in the iterator.
 boolean hasNext()
           
 HippoBean next()
           
 HippoBean nextHippoBean()
          Returns the next HippoBean in the iteration.
 void remove()
           
 void skip(int skipNum)
          Skip a number of elements in the iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HippoBeanIteratorImpl

public HippoBeanIteratorImpl(ObjectConverter objectConverter,
                             javax.jcr.NodeIterator nodeIterator,
                             HstVirtualizer virtualizer)
Method Detail

getPosition

public long getPosition()
Description copied from interface: HippoBeanIterator
Returns the current position within the iterator. The number returned is the 0-based index of the next element in the iterator, i.e. the one that will be returned on the subsequent next call.

Note that this method does not check if there is a next element, i.e. an empty iterator will always return 0.

Specified by:
getPosition in interface HippoBeanIterator
Returns:
a long

getSize

public long getSize()
Description copied from interface: HippoBeanIterator
Returns the number of elements in the iterator. If this information is unavailable, returns -1.

Specified by:
getSize in interface HippoBeanIterator
Returns:
a long

nextHippoBean

public HippoBean nextHippoBean()
Description copied from interface: HippoBeanIterator
Returns the next HippoBean in the iteration. Note this method is allowed to return null when the backing jcr node cannot be mapped to a HippoBean.

Specified by:
nextHippoBean in interface HippoBeanIterator
Returns:
the next HippoBean in the iteration or null if the jcr node cannot be mapped to a HippoBean

skip

public void skip(int skipNum)
Description copied from interface: HippoBeanIterator
Skip a number of elements in the iterator. Using skip is very efficient when you know you want to have the, say, 100 to 110 beans, as the skip does not need to fetch number 1 to 100.

Specified by:
skip in interface HippoBeanIterator
Parameters:
skipNum - the non-negative number of elements to skip

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<HippoBean>

remove

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

next

public HippoBean next()
Specified by:
next in interface Iterator<HippoBean>


Copyright © 2008-2012 Hippo. All Rights Reserved.