edu.uci.ics.jung.graph
Class SortedSparseMultigraph<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.graph.AbstractGraph<V,E>
      extended by edu.uci.ics.jung.graph.SparseMultigraph<V,E>
          extended by edu.uci.ics.jung.graph.OrderedSparseMultigraph<V,E>
              extended by edu.uci.ics.jung.graph.SortedSparseMultigraph<V,E>
All Implemented Interfaces:
Graph<V,E>, Hypergraph<V,E>, MultiGraph<V,E>, Serializable

public class SortedSparseMultigraph<V,E>
extends OrderedSparseMultigraph<V,E>
implements MultiGraph<V,E>, Serializable

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.

Author:
Joshua O'Madadhain
See Also:
Serialized Form

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()
           
SortedSparseMultigraph(Comparator<V> vertex_comparator, Comparator<E> edge_comparator)
           
 
Method Summary
 boolean addVertex(V vertex)
          Adds vertex to this graph.
static
<V,E>
getFactory()
           
 
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, addEdge, addEdge, addEdge, containsEdge, containsVertex, findEdge, 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, 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

vertex_comparator

protected Comparator<V> vertex_comparator
Comparator used in ordering vertices. Defaults to util.ComparableComparator if no comparators are specified in the constructor.


edge_comparator

protected Comparator<E> edge_comparator
Comparator used in ordering edges. Defaults to util.ComparableComparator if no comparators are specified in the constructor.

Constructor Detail

SortedSparseMultigraph

public SortedSparseMultigraph(Comparator<V> vertex_comparator,
                              Comparator<E> edge_comparator)

SortedSparseMultigraph

public SortedSparseMultigraph()
Method Detail

getFactory

public static <V,E>  getFactory()

addVertex

public boolean addVertex(V vertex)
Description copied from interface: Hypergraph
Adds vertex to this graph. Fails if vertex is null or already in the graph.

Specified by:
addVertex in interface Hypergraph<V,E>
Overrides:
addVertex in class OrderedSparseMultigraph<V,E>
Parameters:
vertex - the vertex to add
Returns:
true if the add is successful, and false otherwise


Copyright © 2008 null. All Rights Reserved.