Package org.jungrapht.visualization.util
Class ParallelEdgeIndexFunction<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.util.ParallelEdgeIndexFunction<V,E>
-
- All Implemented Interfaces:
BiFunction<org.jgrapht.Graph<V,E>,E,Integer>,EdgeIndexFunction<V,E>
- Direct Known Subclasses:
PredicatedParallelEdgeIndexFunction
public class ParallelEdgeIndexFunction<V,E> extends Object implements EdgeIndexFunction<V,E>
A class which creates and maintains indices for parallel edges. Parallel edges are defined here to be the collection of edges that are returned bygraph.edgesConnecting(v, w)for somevandw.At this time, users are responsible for resetting the indices (by calling
reset()) if changes to the graph make it appropriate.- Author:
- Joshua O'Madadhain, Tom Nelson
-
-
Constructor Summary
Constructors Constructor Description ParallelEdgeIndexFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integerapply(org.jgrapht.Graph<V,E> graph, E edge)The index ofeis defined as its position in some consistent ordering ofeand all edges parallel toe.voidreset()Clears all edge indices for all edges.voidreset(org.jgrapht.Graph<V,E> graph, E edge)Resets the indices foredgeand its parallel edges.-
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)
Description copied from interface:EdgeIndexFunctionThe index ofeis defined as its position in some consistent ordering ofeand all edges parallel toe.- Specified by:
applyin interfaceBiFunction<org.jgrapht.Graph<V,E>,E,Integer>- Specified by:
applyin interfaceEdgeIndexFunction<V,E>- Parameters:
graph- the graph and the edge whose index is to be queriededge- the edge- Returns:
edge's index in this instance'sGraph.
-
reset
public void reset(org.jgrapht.Graph<V,E> graph, E edge)
Description copied from interface:EdgeIndexFunctionResets the indices foredgeand its parallel edges. Should be invoked when an edge parallel toedgehas been added or removed.- Specified by:
resetin interfaceEdgeIndexFunction<V,E>- Parameters:
graph- the graph and the edge whose index is to be reset
-
reset
public void reset()
Description copied from interface:EdgeIndexFunctionClears all edge indices for all edges. Does not recalculate the indices.- Specified by:
resetin interfaceEdgeIndexFunction<V,E>
-
-