com.lambdazen.bitsy.util.EdgeIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bitsy Show documentation
Show all versions of bitsy Show documentation
Bitsy v3 is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3
package com.lambdazen.bitsy.util;
import java.util.Collection;
import java.util.Iterator;
import com.lambdazen.bitsy.BitsyEdge;
import com.lambdazen.bitsy.UUID;
import com.lambdazen.bitsy.store.EdgeBean;
import com.lambdazen.bitsy.tx.BitsyTransaction;
public class EdgeIterator extends BitsyElementIterator implements Iterator {
private BitsyTransaction tx;
public EdgeIterator(BitsyTransaction tx, Collection txEdges, Collection vertices) {
super(vertices, txEdges.iterator());
this.tx = tx;
}
public EdgeIterator(BitsyTransaction tx, Collection txEdges, Collection vertices, Collection allTxEdges) {
super(vertices, txEdges.iterator(), allTxEdges);
this.tx = tx;
}
@Override
public UUID getId(EdgeBean bean) {
return bean.getId();
}
@Override
public BitsyEdge getElement(EdgeBean bean) {
return (BitsyEdge)tx.getEdge(bean.getId());
}
}