public class SortedSparseMultigraph<V,E> extends OrderedSparseMultigraph<V,E> implements edu.uci.ics.jung.graph.MultiGraph<V,E>
Graph
that is suitable for sparse graphs,
orders its vertex and edge collections according to either specified Comparator
instances or the natural ordering of their elements, and permits directed, undirected,
and parallel edges.Modifier and Type | Field and Description |
---|---|
protected java.util.Comparator<E> |
edge_comparator
Comparator used in ordering edges. |
protected java.util.Comparator<V> |
vertex_comparator
Comparator used in ordering vertices. |
directedEdges, edges, vertices
Constructor and Description |
---|
SortedSparseMultigraph()
Creates a new instance which sorts its vertices and edges according to
their natural ordering.
|
SortedSparseMultigraph(java.util.Comparator<V> vertex_comparator,
java.util.Comparator<E> edge_comparator)
Creates a new instance which sorts its vertices and edges according to the
specified
Comparator s. |
Modifier and Type | Method and Description |
---|---|
boolean |
addVertex(V vertex) |
static <V,E> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<V,E>> |
getFactory()
Returns a
Factory that creates an instance of this graph type. |
void |
setVertexComparator(java.util.Comparator<V> vertex_comparator)
Provides a new
Comparator to be used in sorting the vertices. |
getIncidentEdges, getNeighbors, getPredecessors, getSuccessors
addEdge, containsEdge, containsVertex, findEdge, getDefaultEdgeType, getDest, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getEndpoints, getIncoming_internal, getInEdges, getOutEdges, getOutgoing_internal, getSource, getVertexCount, getVertices, isDest, isSource, removeEdge, removeVertex
addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
protected java.util.Comparator<V> vertex_comparator
Comparator
used in ordering vertices. Defaults to util.ComparableComparator
if no comparators are specified in the constructor.protected java.util.Comparator<E> edge_comparator
Comparator
used in ordering edges. Defaults to util.ComparableComparator
if no comparators are specified in the constructor.public SortedSparseMultigraph(java.util.Comparator<V> vertex_comparator, java.util.Comparator<E> edge_comparator)
Comparator
s.public SortedSparseMultigraph()
public static <V,E> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<V,E>> getFactory()
Factory
that creates an instance of this graph type.V
- the vertex type for the graph factoryE
- the edge type for the graph factorypublic void setVertexComparator(java.util.Comparator<V> vertex_comparator)
Comparator
to be used in sorting the vertices.vertex_comparator
- the comparator that defines the new ordering