Neo4j Community

org.neo4j.helpers.collection
Class IteratorWrapper<T,U>

java.lang.Object
  extended by org.neo4j.helpers.collection.IteratorWrapper<T,U>
Type Parameters:
T - the type of items to return
U - the type of items to wrap/convert from
All Implemented Interfaces:
Iterator<T>

public abstract class IteratorWrapper<T,U>
extends Object
implements Iterator<T>

Wraps an Iterator so that it returns items of another type. The iteration is done lazily.


Constructor Summary
IteratorWrapper(Iterator<U> iteratorToWrap)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
protected abstract  T underlyingObjectToObject(U object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorWrapper

public IteratorWrapper(Iterator<U> iteratorToWrap)
Method Detail

hasNext

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

next

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

remove

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

underlyingObjectToObject

protected abstract T underlyingObjectToObject(U object)

Neo4j Community

Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.