Class PredicatedParallelEdgeIndexFunction<V,E>
java.lang.Object
edu.uci.ics.jung.visualization.util.PredicatedParallelEdgeIndexFunction<V,E>
- All Implemented Interfaces:
EdgeIndexFunction<V,E>
public class PredicatedParallelEdgeIndexFunction<V,E>
extends Object
implements EdgeIndexFunction<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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the index for the specified edge.protected intprotected intstatic <V,E> PredicatedParallelEdgeIndexFunction <V, E> com.google.common.base.Predicate<E> voidreset()Clears all edge indices for all edges in all graphs.voidResets the indices for this edge and its parallel edges.voidsetPredicate(com.google.common.base.Predicate<E> predicate)
-
Field Details
-
edge_index
-
predicate
-
-
Constructor Details
-
PredicatedParallelEdgeIndexFunction
private PredicatedParallelEdgeIndexFunction()- Parameters:
graph- the graph with respect to which the index is calculated
-
-
Method Details
-
getInstance
-
getIndex
Returns the index for the specified edge. Calculates the indices foreand for all edges parallel toe.- Specified by:
getIndexin interfaceEdgeIndexFunction<V,E> - Parameters:
graph- the graph with respect to which the index is calculatede- the edge whose index is to be calculated- Returns:
- the index of the edge with respect to this index function
-
getIndex
-
getIndex
-
getPredicate
-
setPredicate
-
reset
Resets the indices for this edge and its parallel edges. Should be invoked when an edge parallel toehas been added or removed in this graph.- Specified by:
resetin interfaceEdgeIndexFunction<V,E> - Parameters:
graph- the graph with respect to which the index is calculatede- the edge whose indices are to be reset forgraph
-
reset
public void reset()Clears all edge indices for all edges in all graphs. Does not recalculate the indices.- Specified by:
resetin interfaceEdgeIndexFunction<V,E>
-