Package org.jungrapht.visualization.util
Class PredicatedParallelEdgeIndexFunction<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.util.ParallelEdgeIndexFunction<V,E>
-
- org.jungrapht.visualization.util.PredicatedParallelEdgeIndexFunction<V,E>
-
- All Implemented Interfaces:
BiFunction<org.jgrapht.Graph<V,E>,E,Integer>,EdgeIndexFunction<V,E>
public class PredicatedParallelEdgeIndexFunction<V,E> extends ParallelEdgeIndexFunction<V,E>
A class which creates and maintains indices for parallel edges. Edges are evaluated by a Predicate function and those that evaluate to true are excluded from computing a parallel offset.- Author:
- Tom Nelson
-
-
Field Summary
Fields Modifier and Type Field Description protected Predicate<E>predicate-
Fields inherited from class org.jungrapht.visualization.util.ParallelEdgeIndexFunction
edgeIndex
-
-
Constructor Summary
Constructors Constructor Description PredicatedParallelEdgeIndexFunction(Predicate<E> predicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integerapply(org.jgrapht.Graph<V,E> graph, E edge)Returns the index for the specified edge, or 0 ifedgeis accepted by the Predicate.Predicate<E>getPredicate()voidsetPredicate(Predicate<E> predicate)-
Methods inherited from class org.jungrapht.visualization.util.ParallelEdgeIndexFunction
reset, reset
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiFunction
andThen
-
-
-
-
Method Detail
-
apply
public Integer apply(org.jgrapht.Graph<V,E> graph, E edge)
Returns the index for the specified edge, or 0 ifedgeis accepted by the Predicate.- Specified by:
applyin interfaceBiFunction<org.jgrapht.Graph<V,E>,E,Integer>- Specified by:
applyin interfaceEdgeIndexFunction<V,E>- Overrides:
applyin classParallelEdgeIndexFunction<V,E>- Parameters:
graph- the graph and the edge whose index is to be calculatededge- the edge- Returns:
edge's index in this instance'sGraph.
-
-