public class MultidirectedMultiGraph
extends edu.uci.ics.jung.graph.SparseGraph
implements edu.uci.ics.jung.graph.Graph, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
INCIDENT
Indicates incident (undirected) edges in the map
|
protected static int |
INCOMING
Indicates incoming edges in the map
|
protected java.util.Map |
mdirected_edges
Map of directed edges to incident vertex sets
|
protected java.util.Map |
mundirected_edges
Map of undirected edges to incident vertex sets
|
protected java.util.Map |
mvertex_maps
Map of vertices to adjacency maps of vertices to {incoming, outgoing,
incident} edges
|
protected static int |
OUTGOING
Indicates outgoing edges in the map
|
| Constructor and Description |
|---|
MultidirectedMultiGraph()
Creates a new graph.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdge(java.lang.Object e,
java.lang.Object v1,
java.lang.Object v2)
Adds a directed edge to the graph.
|
boolean |
addEdge(java.lang.Object e,
java.lang.Object v1,
java.lang.Object v2,
edu.uci.ics.jung.graph.util.EdgeType edgeType)
Adds a edge to the graph with a specific edge type.
|
boolean |
addEdge(java.lang.Object edge,
edu.uci.ics.jung.graph.util.Pair endpoints)
Adds a directed edge to the graph.
|
boolean |
addEdge(java.lang.Object edge,
edu.uci.ics.jung.graph.util.Pair endpoints,
edu.uci.ics.jung.graph.util.EdgeType edgeType)
Adds a edge to the graph with a specific edge type.
|
boolean |
addVertex(java.lang.Object vertex)
Adds a vertex to the graph.
|
boolean |
containsEdge(java.lang.Object edge)
Returns
true if the graph contains the edge. |
boolean |
containsVertex(java.lang.Object vertex)
Returns
true if the graph contains the vertex. |
static edu.uci.ics.jung.graph.Graph |
create()
Returns a new MultidirectedMultiGraph.
|
int |
degree(java.lang.Object vertex)
Returns the degree (number of incident edges) of a vertex.
|
java.lang.Object |
findEdge(java.lang.Object v1,
java.lang.Object v2)
Returns the first edge between the two vertices.
|
java.util.Collection |
findEdgeSet(java.lang.Object v1,
java.lang.Object v2)
Returns a collection of edges between the two vertices.
|
java.lang.Object |
getDest(java.lang.Object directed_edge)
Returns the destination of a directed edge.
|
int |
getEdgeCount() |
java.util.Collection |
getEdges()
Returns all edges of the graph.
|
java.util.Collection |
getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)
Returns the edges for a given edge type.
|
edu.uci.ics.jung.graph.util.EdgeType |
getEdgeType(java.lang.Object edge)
Returns the edge type of en edge.
|
edu.uci.ics.jung.graph.util.Pair |
getEndpoints(java.lang.Object edge)
Returns the endpoints of the edge.
|
static org.apache.commons.collections15.Factory |
getFactory()
Returns the factory for the graph.
|
protected java.util.Collection |
getIncident_internal(java.lang.Object vertex)
Returns the incident edges of the vertex
|
java.util.Collection |
getIncidentEdges(java.lang.Object vertex)
Returns the incident edges of the vertex.
|
protected java.util.Collection |
getIncoming_internal(java.lang.Object vertex)
Returns the incoming edges of the vertex
|
java.util.Collection |
getInEdges(java.lang.Object vertex)
Returns the incoming edges of the vertex.
|
java.util.Collection |
getNeighbors(java.lang.Object vertex)
Returns the neighbor vertices of a given vertex.
|
java.util.Collection |
getOutEdges(java.lang.Object vertex)
Returns the outgoing edges of the vertex.
|
protected java.util.Collection |
getOutgoing_internal(java.lang.Object vertex)
Returns the outgoing edges of the vertex
|
java.util.Collection |
getPredecessors(java.lang.Object vertex)
Returns the vertices that have an outgoing edge to the given vertex.
|
java.lang.Object |
getSource(java.lang.Object directed_edge)
Returns the source of a directed edge.
|
java.util.Collection |
getSuccessors(java.lang.Object vertex)
Returns the vertices that have an incoming edge from the given vertex.
|
int |
getVertexCount() |
java.util.Collection |
getVertices()
Returns all vertices of the graph.
|
boolean |
isDest(java.lang.Object vertex,
java.lang.Object edge)
Returns
true if the vertex is the destination of the edge. |
boolean |
isSource(java.lang.Object vertex,
java.lang.Object edge)
Returns
true if the vertex is the source of the edge. |
boolean |
removeEdge(java.lang.Object edge)
Removes a edge from the graph.
|
boolean |
removeVertex(java.lang.Object vertex)
Removes a vertex from the graph.
|
addEdge, addEdge, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected static final int INCOMING
protected static final int OUTGOING
protected static final int INCIDENT
protected java.util.Map mvertex_maps
protected java.util.Map mdirected_edges
protected java.util.Map mundirected_edges
public static org.apache.commons.collections15.Factory getFactory()
public static edu.uci.ics.jung.graph.Graph create()
public boolean addEdge(java.lang.Object edge,
edu.uci.ics.jung.graph.util.Pair endpoints)
addEdge in class edu.uci.ics.jung.graph.AbstractGraphedge - The edge.endpoints - The endpoints.true if success.public boolean addEdge(java.lang.Object edge,
edu.uci.ics.jung.graph.util.Pair endpoints,
edu.uci.ics.jung.graph.util.EdgeType edgeType)
addEdge in class edu.uci.ics.jung.graph.SparseGraphedge - The edge.endpoints - The endpoints.edgeType - The edge type.true if success.public boolean addEdge(java.lang.Object e,
java.lang.Object v1,
java.lang.Object v2)
addEdge in interface edu.uci.ics.jung.graph.GraphaddEdge in class edu.uci.ics.jung.graph.AbstractGraphedge - The edge.v1 - The first vertex.v2 - The second vertex.true if success.public boolean addEdge(java.lang.Object e,
java.lang.Object v1,
java.lang.Object v2,
edu.uci.ics.jung.graph.util.EdgeType edgeType)
addEdge in interface edu.uci.ics.jung.graph.GraphaddEdge in class edu.uci.ics.jung.graph.AbstractGraphedge - The edge.v1 - The first vertex.v2 - The second vertex..edgeType - The edge type.true if success.public java.lang.Object findEdge(java.lang.Object v1,
java.lang.Object v2)
findEdge in interface edu.uci.ics.jung.graph.HypergraphfindEdge in class edu.uci.ics.jung.graph.SparseGraphv1 - The first vertex.v2 - The second vertex.null if there is no incident edge
between the vertices.public java.util.Collection findEdgeSet(java.lang.Object v1,
java.lang.Object v2)
findEdgeSet in interface edu.uci.ics.jung.graph.HypergraphfindEdgeSet in class edu.uci.ics.jung.graph.SparseGraphv1 - The first vertex.v2 - The second vertex.null if there is no
incident edge between the vertices.public java.util.Collection getInEdges(java.lang.Object vertex)
getInEdges in interface edu.uci.ics.jung.graph.GraphgetInEdges in interface edu.uci.ics.jung.graph.HypergraphgetInEdges in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertxpublic java.util.Collection getOutEdges(java.lang.Object vertex)
getOutEdges in interface edu.uci.ics.jung.graph.GraphgetOutEdges in interface edu.uci.ics.jung.graph.HypergraphgetOutEdges in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertxpublic java.util.Collection getPredecessors(java.lang.Object vertex)
getPredecessors in interface edu.uci.ics.jung.graph.GraphgetPredecessors in interface edu.uci.ics.jung.graph.HypergraphgetPredecessors in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.public java.util.Collection getSuccessors(java.lang.Object vertex)
getSuccessors in interface edu.uci.ics.jung.graph.GraphgetSuccessors in interface edu.uci.ics.jung.graph.HypergraphgetSuccessors in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.public java.util.Collection getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)
getEdges in interface edu.uci.ics.jung.graph.HypergraphgetEdges in class edu.uci.ics.jung.graph.SparseGraphedgeType - The edge tzpe.public edu.uci.ics.jung.graph.util.Pair getEndpoints(java.lang.Object edge)
getEndpoints in interface edu.uci.ics.jung.graph.GraphgetEndpoints in class edu.uci.ics.jung.graph.SparseGraphedge - The edge.public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(java.lang.Object edge)
getEdgeType in interface edu.uci.ics.jung.graph.HypergraphgetEdgeType in class edu.uci.ics.jung.graph.SparseGraphedge - The edge.public java.lang.Object getSource(java.lang.Object directed_edge)
getSource in interface edu.uci.ics.jung.graph.GraphgetSource in interface edu.uci.ics.jung.graph.HypergraphgetSource in class edu.uci.ics.jung.graph.SparseGraphdirected_edge - The edge.public java.lang.Object getDest(java.lang.Object directed_edge)
getDest in interface edu.uci.ics.jung.graph.GraphgetDest in interface edu.uci.ics.jung.graph.HypergraphgetDest in class edu.uci.ics.jung.graph.SparseGraphdirected_edge - The edge.public boolean isSource(java.lang.Object vertex,
java.lang.Object edge)
true if the vertex is the source of the edge.isSource in interface edu.uci.ics.jung.graph.GraphisSource in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.edge - The edge.true if the vertex is the source.public boolean isDest(java.lang.Object vertex,
java.lang.Object edge)
true if the vertex is the destination of the edge.isDest in interface edu.uci.ics.jung.graph.GraphisDest in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.edge - The edge.true if the vertex is the destination.public java.util.Collection getEdges()
getEdges in interface edu.uci.ics.jung.graph.HypergraphgetEdges in class edu.uci.ics.jung.graph.SparseGraphpublic java.util.Collection getVertices()
getVertices in interface edu.uci.ics.jung.graph.HypergraphgetVertices in class edu.uci.ics.jung.graph.SparseGraphpublic boolean containsVertex(java.lang.Object vertex)
true if the graph contains the vertex.containsVertex in interface edu.uci.ics.jung.graph.HypergraphcontainsVertex in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.true if the vertex is in the graph.public boolean containsEdge(java.lang.Object edge)
true if the graph contains the edge.containsEdge in interface edu.uci.ics.jung.graph.HypergraphcontainsEdge in class edu.uci.ics.jung.graph.SparseGraphedge - The edge.true if the edge is in the graph.public int getEdgeCount()
getEdgeCount in interface edu.uci.ics.jung.graph.HypergraphgetEdgeCount in class edu.uci.ics.jung.graph.SparseGraphpublic int getVertexCount()
getVertexCount in interface edu.uci.ics.jung.graph.HypergraphgetVertexCount in class edu.uci.ics.jung.graph.SparseGraphpublic java.util.Collection getNeighbors(java.lang.Object vertex)
getNeighbors in interface edu.uci.ics.jung.graph.HypergraphgetNeighbors in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.public int degree(java.lang.Object vertex)
degree in interface edu.uci.ics.jung.graph.Hypergraphdegree in class edu.uci.ics.jung.graph.AbstractGraphvertex - The vertex.public java.util.Collection getIncidentEdges(java.lang.Object vertex)
getIncidentEdges in interface edu.uci.ics.jung.graph.HypergraphgetIncidentEdges in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.public boolean addVertex(java.lang.Object vertex)
addVertex in interface edu.uci.ics.jung.graph.HypergraphaddVertex in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.true if success.public boolean removeVertex(java.lang.Object vertex)
removeVertex in interface edu.uci.ics.jung.graph.HypergraphremoveVertex in class edu.uci.ics.jung.graph.SparseGraphvertex - The vertex.true if successpublic boolean removeEdge(java.lang.Object edge)
removeEdge in interface edu.uci.ics.jung.graph.HypergraphremoveEdge in class edu.uci.ics.jung.graph.SparseGraphedge - The edge.true if successprotected java.util.Collection getIncoming_internal(java.lang.Object vertex)
vertex - The vertex.protected java.util.Collection getIncident_internal(java.lang.Object vertex)
vertex - The vertex.protected java.util.Collection getOutgoing_internal(java.lang.Object vertex)
vertex - The vertex.