Sha256: eda083999f6243907be1c853b83aa64556b2fb3033791e8de1bfd3ffadcac09b

Contents?: true

Size: 854 Bytes

Versions: 11

Compression:

Stored size: 854 Bytes

Contents

package com.xnlogic.pacer.pipes;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.pipes.AbstractPipe;

public class LabelCollectionFilterPipe extends AbstractPipe<Edge, Edge> {
    private Set<String> labels;

    public LabelCollectionFilterPipe(final Collection<String> labels) {
        if (labels instanceof Set) {
            this.labels = (Set<String>)labels;
        } else {
        	this.labels = new HashSet<String>();
        	if(labels != null){
        		this.labels.addAll(labels);
        	}
        }
    }

    protected Edge processNextStart() {
        while (true) {
            Edge edge = this.starts.next();
            if (edge != null && this.labels.contains(edge.getLabel())) {
                return edge;
            }
        }
    }
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pacer-2.0.24-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.22-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.20-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.19-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.18-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.17-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.16-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.15-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.14-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.13-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java
pacer-2.0.12-java ext/src/main/java/com/xnlogic/pacer/pipes/LabelCollectionFilterPipe.java