edu.uci.ics.jung.graph
Class SortedSparseMultigraph<V,E>
- 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>
-
- All Implemented Interfaces:
- Graph<V,E>, Hypergraph<V,E>, MultiGraph<V,E>, java.io.Serializable
public class SortedSparseMultigraph<V,E> extends OrderedSparseMultigraph<V,E> implements MultiGraph<V,E>
An implementation ofGraphthat is suitable for sparse graphs, orders its vertex and edge collections according to either specifiedComparatorinstances or the natural ordering of their elements, and permits directed, undirected, and parallel edges.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors 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 specifiedComparators.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddVertex(V vertex)Addsvertexto this graph.static <V,E> com.google.common.base.Supplier<Graph<V,E>>getFactory()voidsetVertexComparator(java.util.Comparator<V> vertex_comparator)Provides a newComparatorto 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, getInEdges, getOutEdges, 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, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
-
-
-
-
Constructor Detail
-
SortedSparseMultigraph
public 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 specifiedComparators.- Parameters:
vertex_comparator- specifies how the vertices are to be comparededge_comparator- specifies how the edges are to be compared
-
SortedSparseMultigraph
public SortedSparseMultigraph()
Creates a new instance which sorts its vertices and edges according to their natural ordering.
-
-
Method Detail
-
getFactory
public static <V,E> com.google.common.base.Supplier<Graph<V,E>> getFactory()
- Type Parameters:
V- the vertex type for the graph SupplierE- the edge type for the graph Supplier- Returns:
- a
Supplierthat creates an instance of this graph type.
-
setVertexComparator
public void setVertexComparator(java.util.Comparator<V> vertex_comparator)
Provides a newComparatorto be used in sorting the vertices.- Parameters:
vertex_comparator- the comparator that defines the new ordering
-
addVertex
public boolean addVertex(V vertex)
Description copied from interface:HypergraphAddsvertexto this graph. Fails ifvertexis null or already in the graph.- Specified by:
addVertexin interfaceHypergraph<V,E>- Overrides:
addVertexin classOrderedSparseMultigraph<V,E>- Parameters:
vertex- the vertex to add- Returns:
trueif the add is successful, andfalseotherwise
-
-
DataMelt 3.0 © DataMelt by jWork.ORG