
com.tinkerpop.blueprints.impls.neo4j2.batch.Neo4j2BatchVertexIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of blueprints-neo4j2-graph Show documentation
Show all versions of blueprints-neo4j2-graph Show documentation
Blueprints property graph implementation for the Neo4j 2 graph database
The newest version!
package com.tinkerpop.blueprints.impls.neo4j2.batch;
import com.tinkerpop.blueprints.CloseableIterable;
import com.tinkerpop.blueprints.Vertex;
import org.neo4j.graphdb.index.IndexHits;
import java.util.Iterator;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
class Neo4j2BatchVertexIterable implements CloseableIterable {
private final IndexHits hits;
private final Neo4j2BatchGraph graph;
public Neo4j2BatchVertexIterable(final Neo4j2BatchGraph graph, final IndexHits hits) {
this.hits = hits;
this.graph = graph;
}
public Iterator iterator() {
return new Iterator() {
private final Iterator itty = hits.iterator();
public void remove() {
itty.remove();
}
public boolean hasNext() {
return hits.hasNext();
}
public Vertex next() {
return new Neo4j2BatchVertex(graph, itty.next());
}
};
}
public void close() {
hits.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy