All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lambdazen.bitsy.util.EdgeIterator Maven / Gradle / Ivy

Go to download

Bitsy v3 is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3

There is a newer version: 3.6.2
Show newest version
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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy