org.neo4j.helpers.collection
Class FirstItemIterable<T>
java.lang.Object
org.neo4j.helpers.collection.FirstItemIterable<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Iterable<T>
public class FirstItemIterable<T>
- extends Object
- implements Iterable<T>
Wraps the given iterator but keeps the first item to allow later
access to it, like CachingIterator but with less memory overhead.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FirstItemIterable
public FirstItemIterable(Iterable<T> data)
FirstItemIterable
public FirstItemIterable(Iterator<T> iterator)
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
getFirst
public T getFirst()
Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.