com.dooapp.gaedo.blueprints.VertexLoaderIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gaedo-blueprints Show documentation
Show all versions of gaedo-blueprints Show documentation
Implementation of gaedo mechanisms backed by blueprints graph layer
package com.dooapp.gaedo.blueprints;
import java.util.Iterator;
import com.tinkerpop.blueprints.Vertex;
public class VertexLoaderIterable implements Iterable {
private class VertexLoaderIterator implements Iterator {
private Iterator iterator;
public VertexLoaderIterator(Iterator iterator) {
this.iterator = iterator;
}
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public DataType next() {
return service.loadObject(iterator.next(), cache);
}
@Override
public void remove() {
iterator.remove();
}
}
private AbstractBluePrintsBackedFinderService, DataType, ?> service;
private Iterable vertices;
private ObjectCache cache = new ObjectCache();
public VertexLoaderIterable(AbstractBluePrintsBackedFinderService, DataType, ?> abstractBluePrintsBackedFinderService,
Iterable verticesIterable) {
this.service = abstractBluePrintsBackedFinderService;
this.vertices = verticesIterable;
}
@Override
public Iterator iterator() {
return new VertexLoaderIterator(vertices.iterator());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy