cdc.graphs.impl.GraphEdgeOutgoingPredicate Maven / Gradle / Ivy
package cdc.graphs.impl;
import java.util.function.Predicate;
import cdc.graphs.GraphEdge;
/**
* Edge predicate for outgoing edges of a node.
*
* @author Damien Carbonne
*
* @param Node type.
*/
public final class GraphEdgeOutgoingPredicate implements Predicate> {
/** Reference node. */
final N node;
public GraphEdgeOutgoingPredicate(N node) {
this.node = node;
}
@Override
public boolean test(GraphEdge edge) {
return edge.getSource() == node;
}
}