org.neo4j.graphdb
Interface ResourceIterator<T>

Type Parameters:
T - type of values returned by this Iterator
All Superinterfaces:
Closeable, Iterator<T>

public interface ResourceIterator<T>
extends Iterator<T>, Closeable

Closeable Iterator with associated resources that needs to be managed.

However, if your code might not exhaust the iterator, (run until Iterator.hasNext() returns false), ResourceIterator provides you with a close() method that should be invoked to free its resources, by using a finally-block, or try-with-resource.

See Also:
ResourceIterable, Transaction

Method Summary
 void close()
          Close the iterator early, freeing associated resources It is an error to use the iterator after this has been called.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

close

void close()
Close the iterator early, freeing associated resources It is an error to use the iterator after this has been called.

Specified by:
close in interface Closeable


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