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

org.securegraph.accumulo.GetVertexIdsIterable Maven / Gradle / Ivy

The newest version!
package org.securegraph.accumulo;

import org.securegraph.util.LookAheadIterable;

import java.util.Collection;
import java.util.Iterator;

class GetVertexIdsIterable extends LookAheadIterable {
    private final Collection edgeInfos;
    private final String[] labels;

    public GetVertexIdsIterable(Collection edgeInfos, String[] labels) {
        this.edgeInfos = edgeInfos;
        this.labels = labels;
    }

    @Override
    protected boolean isIncluded(EdgeInfo edgeInfo, String vertexId) {
        if (labels == null || labels.length == 0) {
            return true;
        }
        for (String label : labels) {
            if (edgeInfo.getLabel().equals(label)) {
                return true;
            }
        }
        return false;
    }

    @Override
    protected String convert(EdgeInfo edgeInfo) {
        return edgeInfo.getVertexId();
    }

    @Override
    protected Iterator createIterator() {
        return edgeInfos.iterator();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy