|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.graph.AbstractGraph<V,E> edu.uci.ics.jung.graph.SparseMultigraph<V,E> edu.uci.ics.jung.graph.OrderedSparseMultigraph<V,E> edu.uci.ics.jung.graph.SortedSparseMultigraph<V,E>
public class SortedSparseMultigraph<V,E>
An implementation of 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.
Field Summary | |
---|---|
protected Comparator<E> |
edge_comparator
Comparator used in ordering edges. |
protected Comparator<V> |
vertex_comparator
Comparator used in ordering vertices. |
Fields inherited from class edu.uci.ics.jung.graph.SparseMultigraph |
---|
directedEdges, edges, vertices |
Constructor Summary | |
---|---|
SortedSparseMultigraph()
Creates a new instance which sorts its vertices and edges according to their natural ordering. |
|
SortedSparseMultigraph(Comparator<V> vertex_comparator,
Comparator<E> edge_comparator)
Creates a new instance which sorts its vertices and edges according to the specified Comparator s. |
Method Summary | ||
---|---|---|
boolean |
addVertex(V vertex)
Adds vertex to this graph. |
|
static
|
getFactory()
Returns a Factory that creates an instance of this graph type. |
|
void |
setVertexComparator(Comparator<V> vertex_comparator)
Provides a new Comparator to be used in sorting the vertices. |
Methods inherited from class edu.uci.ics.jung.graph.OrderedSparseMultigraph |
---|
getIncidentEdges, getNeighbors, getPredecessors, getSuccessors |
Methods inherited from class edu.uci.ics.jung.graph.SparseMultigraph |
---|
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 |
Methods inherited from class edu.uci.ics.jung.graph.AbstractGraph |
---|
addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Comparator<V> vertex_comparator
Comparator
used in ordering vertices. Defaults to util.ComparableComparator
if no comparators are specified in the constructor.
protected Comparator<E> edge_comparator
Comparator
used in ordering edges. Defaults to util.ComparableComparator
if no comparators are specified in the constructor.
Constructor Detail |
---|
public SortedSparseMultigraph(Comparator<V> vertex_comparator, Comparator<E> edge_comparator)
Comparator
s.
public SortedSparseMultigraph()
Method Detail |
---|
public static <V,E> org.apache.commons.collections15.Factory<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(Comparator<V> vertex_comparator)
Comparator
to be used in sorting the vertices.
vertex_comparator
- the comparator that defines the new orderingpublic boolean addVertex(V vertex)
Hypergraph
vertex
to this graph.
Fails if vertex
is null or already in the graph.
addVertex
in interface Hypergraph<V,E>
addVertex
in class OrderedSparseMultigraph<V,E>
vertex
- the vertex to add
true
if the add is successful, and false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |