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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected 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.AbstractGraph
edge
- 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.SparseGraph
edge
- 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.Graph
addEdge
in class edu.uci.ics.jung.graph.AbstractGraph
edge
- 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.Graph
addEdge
in class edu.uci.ics.jung.graph.AbstractGraph
edge
- 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.Hypergraph
findEdge
in class edu.uci.ics.jung.graph.SparseGraph
v1
- 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.Hypergraph
findEdgeSet
in class edu.uci.ics.jung.graph.SparseGraph
v1
- 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.Graph
getInEdges
in interface edu.uci.ics.jung.graph.Hypergraph
getInEdges
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertxpublic java.util.Collection getOutEdges(java.lang.Object vertex)
getOutEdges
in interface edu.uci.ics.jung.graph.Graph
getOutEdges
in interface edu.uci.ics.jung.graph.Hypergraph
getOutEdges
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertxpublic java.util.Collection getPredecessors(java.lang.Object vertex)
getPredecessors
in interface edu.uci.ics.jung.graph.Graph
getPredecessors
in interface edu.uci.ics.jung.graph.Hypergraph
getPredecessors
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.public java.util.Collection getSuccessors(java.lang.Object vertex)
getSuccessors
in interface edu.uci.ics.jung.graph.Graph
getSuccessors
in interface edu.uci.ics.jung.graph.Hypergraph
getSuccessors
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.public java.util.Collection getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)
getEdges
in interface edu.uci.ics.jung.graph.Hypergraph
getEdges
in class edu.uci.ics.jung.graph.SparseGraph
edgeType
- The edge tzpe.public edu.uci.ics.jung.graph.util.Pair getEndpoints(java.lang.Object edge)
getEndpoints
in interface edu.uci.ics.jung.graph.Graph
getEndpoints
in class edu.uci.ics.jung.graph.SparseGraph
edge
- The edge.public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(java.lang.Object edge)
getEdgeType
in interface edu.uci.ics.jung.graph.Hypergraph
getEdgeType
in class edu.uci.ics.jung.graph.SparseGraph
edge
- The edge.public java.lang.Object getSource(java.lang.Object directed_edge)
getSource
in interface edu.uci.ics.jung.graph.Graph
getSource
in interface edu.uci.ics.jung.graph.Hypergraph
getSource
in class edu.uci.ics.jung.graph.SparseGraph
directed_edge
- The edge.public java.lang.Object getDest(java.lang.Object directed_edge)
getDest
in interface edu.uci.ics.jung.graph.Graph
getDest
in interface edu.uci.ics.jung.graph.Hypergraph
getDest
in class edu.uci.ics.jung.graph.SparseGraph
directed_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.Graph
isSource
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- 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.Graph
isDest
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- 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.Hypergraph
getEdges
in class edu.uci.ics.jung.graph.SparseGraph
public java.util.Collection getVertices()
getVertices
in interface edu.uci.ics.jung.graph.Hypergraph
getVertices
in class edu.uci.ics.jung.graph.SparseGraph
public boolean containsVertex(java.lang.Object vertex)
true
if the graph contains the vertex.containsVertex
in interface edu.uci.ics.jung.graph.Hypergraph
containsVertex
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- 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.Hypergraph
containsEdge
in class edu.uci.ics.jung.graph.SparseGraph
edge
- The edge.true
if the edge is in the graph.public int getEdgeCount()
getEdgeCount
in interface edu.uci.ics.jung.graph.Hypergraph
getEdgeCount
in class edu.uci.ics.jung.graph.SparseGraph
public int getVertexCount()
getVertexCount
in interface edu.uci.ics.jung.graph.Hypergraph
getVertexCount
in class edu.uci.ics.jung.graph.SparseGraph
public java.util.Collection getNeighbors(java.lang.Object vertex)
getNeighbors
in interface edu.uci.ics.jung.graph.Hypergraph
getNeighbors
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.public int degree(java.lang.Object vertex)
degree
in interface edu.uci.ics.jung.graph.Hypergraph
degree
in class edu.uci.ics.jung.graph.AbstractGraph
vertex
- The vertex.public java.util.Collection getIncidentEdges(java.lang.Object vertex)
getIncidentEdges
in interface edu.uci.ics.jung.graph.Hypergraph
getIncidentEdges
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.public boolean addVertex(java.lang.Object vertex)
addVertex
in interface edu.uci.ics.jung.graph.Hypergraph
addVertex
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.true
if success.public boolean removeVertex(java.lang.Object vertex)
removeVertex
in interface edu.uci.ics.jung.graph.Hypergraph
removeVertex
in class edu.uci.ics.jung.graph.SparseGraph
vertex
- The vertex.true
if successpublic boolean removeEdge(java.lang.Object edge)
removeEdge
in interface edu.uci.ics.jung.graph.Hypergraph
removeEdge
in class edu.uci.ics.jung.graph.SparseGraph
edge
- 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.