net.sourceforge.openutils.mgnlcriteria.jcr.query
Class ResultIteratorImpl<T>

java.lang.Object
  extended by net.sourceforge.openutils.mgnlcriteria.jcr.query.ResultIteratorImpl<T>
Type Parameters:
T - type of results
All Implemented Interfaces:
Iterable<T>, Iterator, javax.jcr.RangeIterator, ResultIterator<T>
Direct Known Subclasses:
AdvancedResultItemResultIterator

public abstract class ResultIteratorImpl<T>
extends Object
implements ResultIterator<T>

Wraps a RowIterator, requiring subclasses to adapt each Row to a specific type.

Version:
$Id: ResultIteratorImpl.java 3285 2011-01-24 18:10:19Z fgiust $
Author:
fgiust

Field Summary
protected  info.magnolia.cms.core.HierarchyManager hm
          Magnolia Hierarchy Manager
protected  javax.jcr.query.RowIterator rowIterator
          The jcr RowIterator
 
Constructor Summary
ResultIteratorImpl(javax.jcr.query.RowIterator rowIterator, info.magnolia.cms.core.HierarchyManager hm)
           
 
Method Summary
 long getPosition()
          
 long getSize()
          
 boolean hasNext()
          
 Iterator<T> iterator()
          Adds foreach support.
 T next()
          
 void remove()
          
 void skip(long skipNum)
          
protected abstract  T wrap(javax.jcr.query.Row row)
          Transforms a Row instance, adapting it to a specific type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowIterator

protected javax.jcr.query.RowIterator rowIterator
The jcr RowIterator


hm

protected final info.magnolia.cms.core.HierarchyManager hm
Magnolia Hierarchy Manager

Constructor Detail

ResultIteratorImpl

public ResultIteratorImpl(javax.jcr.query.RowIterator rowIterator,
                          info.magnolia.cms.core.HierarchyManager hm)
Parameters:
rowIterator -
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator

remove

public void remove()

Specified by:
remove in interface Iterator

skip

public void skip(long skipNum)

Specified by:
skip in interface javax.jcr.RangeIterator

getSize

public long getSize()

Specified by:
getSize in interface javax.jcr.RangeIterator

getPosition

public long getPosition()

Specified by:
getPosition in interface javax.jcr.RangeIterator

next

public T next()

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

iterator

public Iterator<T> iterator()
Adds foreach support.

Specified by:
iterator in interface Iterable<T>

wrap

protected abstract T wrap(javax.jcr.query.Row row)
Transforms a Row instance, adapting it to a specific type.

Parameters:
row - the jcr Row to wrap
Returns:
a transformed version


Copyright © 2009-2011 Openmind. All Rights Reserved.