Package edu.uci.ics.jung.graph.util
Class DefaultParallelEdgeIndexFunction<V,E>
java.lang.Object
edu.uci.ics.jung.graph.util.DefaultParallelEdgeIndexFunction<V,E>
- All Implemented Interfaces:
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 by
v.findEdgeSet(w)
for some
v
and w
.
At this time, users are responsible for resetting the indices
(by calling reset()
) if changes to the
graph make it appropriate.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the index fore
ingraph
.protected int
protected int
static <V,
E> DefaultParallelEdgeIndexFunction <V, E> void
reset()
Clears all edge indices for all edges in all graphs.void
Resets the indices for this edge and its parallel edges.
-
Field Details
-
edge_index
-
-
Constructor Details
-
DefaultParallelEdgeIndexFunction
private DefaultParallelEdgeIndexFunction()
-
-
Method Details
-
getInstance
- Type Parameters:
V
- the vertex typeE
- the edge type- Returns:
- an instance of this class
-
getIndex
Returns the index fore
ingraph
. Calculates the indices fore
and for all edges parallel toe
, if they are not already assigned.- Specified by:
getIndex
in interfaceEdgeIndexFunction<V,
E> - Parameters:
graph
- the graph with respect to which the index is calculatede
- the edge whose index is to be queried- Returns:
e
's index ingraph
-
getIndex
-
getIndex
-
reset
Resets the indices for this edge and its parallel edges. Should be invoked when an edge parallel toe
has been added or removed.- Specified by:
reset
in interfaceEdgeIndexFunction<V,
E> - Parameters:
graph
- the graph for which the indices are to be resete
- the edge whose indices are to be reset
-
reset
public void reset()Clears all edge indices for all edges in all graphs. Does not recalculate the indices.- Specified by:
reset
in interfaceEdgeIndexFunction<V,
E>
-