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