Package edu.uci.ics.jung.graph.util
Interface EdgeIndexFunction<V,E>
-
- All Known Implementing Classes:
DefaultParallelEdgeIndexFunction,IncidentEdgeIndexFunction,PredicatedParallelEdgeIndexFunction
public interface EdgeIndexFunction<V,E>An interface for a service to access the index of a given edge (in a given graph) into the set formed by the given edge and all the other edges it is parallel to.Note that in current use, this index is assumed to be an integer value in the interval [0,n-1], where n-1 is the number of edges parallel to
e.- Author:
- Tom Nelson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetIndex(Graph<V,E> graph, E e)Returnse's index ingraph.voidreset()Clears all edge indices for all edges in all graphs.voidreset(Graph<V,E> g, E edge)Resets the indices foredgeand its parallel edges ingraph.
-
-
-
Method Detail
-
getIndex
int getIndex(Graph<V,E> graph, E e)
Returnse's index ingraph. The index ofeis defined as its position in some consistent ordering ofeand all edges parallel toe.- 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
-
reset
void reset(Graph<V,E> g, E edge)
Resets the indices foredgeand its parallel edges ingraph. Should be invoked when an edge parallel toedgehas been added or removed.- Parameters:
g- the graph in whichedge's index is to be resetedge- the edge whose index is to be reset
-
reset
void reset()
Clears all edge indices for all edges in all graphs. Does not recalculate the indices.
-
-