Package jadex.tools.comanalyzer.graph
Class MultidirectedMultiGraph
- java.lang.Object
- 
- edu.uci.ics.jung.graph.AbstractGraph<V,E>
- 
- edu.uci.ics.jung.graph.SparseGraph
- 
- jadex.tools.comanalyzer.graph.MultidirectedMultiGraph
 
 
 
- 
- All Implemented Interfaces:
- edu.uci.ics.jung.graph.Graph,- edu.uci.ics.jung.graph.Hypergraph,- java.io.Serializable
 
 public class MultidirectedMultiGraph extends edu.uci.ics.jung.graph.SparseGraph implements edu.uci.ics.jung.graph.Graph, java.io.SerializableImplementation of an Graph that can be used as a simple or a multi graph with directed and undirected edges.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static intINCIDENTIndicates incident (undirected) edges in the mapprotected static intINCOMINGIndicates incoming edges in the mapprotected java.util.Mapmdirected_edgesMap of directed edges to incident vertex setsprotected java.util.Mapmundirected_edgesMap of undirected edges to incident vertex setsprotected java.util.Mapmvertex_mapsMap of vertices to adjacency maps of vertices to {incoming, outgoing, incident} edgesprotected static intOUTGOINGIndicates outgoing edges in the map
 - 
Constructor SummaryConstructors Constructor Description MultidirectedMultiGraph()Creates a new graph.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEdge(java.lang.Object edge, edu.uci.ics.jung.graph.util.Pair endpoints)Adds a directed edge to the graph.booleanaddEdge(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.booleanaddEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)Adds a directed edge to the graph.booleanaddEdge(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.booleanaddVertex(java.lang.Object vertex)Adds a vertex to the graph.booleancontainsEdge(java.lang.Object edge)Returnstrueif the graph contains the edge.booleancontainsVertex(java.lang.Object vertex)Returnstrueif the graph contains the vertex.static edu.uci.ics.jung.graph.Graphcreate()Returns a new MultidirectedMultiGraph.intdegree(java.lang.Object vertex)Returns the degree (number of incident edges) of a vertex.java.lang.ObjectfindEdge(java.lang.Object v1, java.lang.Object v2)Returns the first edge between the two vertices.java.util.CollectionfindEdgeSet(java.lang.Object v1, java.lang.Object v2)Returns a collection of edges between the two vertices.java.lang.ObjectgetDest(java.lang.Object directed_edge)Returns the destination of a directed edge.intgetEdgeCount()java.util.CollectiongetEdges()Returns all edges of the graph.java.util.CollectiongetEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)Returns the edges for a given edge type.edu.uci.ics.jung.graph.util.EdgeTypegetEdgeType(java.lang.Object edge)Returns the edge type of en edge.edu.uci.ics.jung.graph.util.PairgetEndpoints(java.lang.Object edge)Returns the endpoints of the edge.static org.apache.commons.collections15.FactorygetFactory()Returns the factory for the graph.protected java.util.CollectiongetIncident_internal(java.lang.Object vertex)Returns the incident edges of the vertexjava.util.CollectiongetIncidentEdges(java.lang.Object vertex)Returns the incident edges of the vertex.protected java.util.CollectiongetIncoming_internal(java.lang.Object vertex)Returns the incoming edges of the vertexjava.util.CollectiongetInEdges(java.lang.Object vertex)Returns the incoming edges of the vertex.java.util.CollectiongetNeighbors(java.lang.Object vertex)Returns the neighbor vertices of a given vertex.java.util.CollectiongetOutEdges(java.lang.Object vertex)Returns the outgoing edges of the vertex.protected java.util.CollectiongetOutgoing_internal(java.lang.Object vertex)Returns the outgoing edges of the vertexjava.util.CollectiongetPredecessors(java.lang.Object vertex)Returns the vertices that have an outgoing edge to the given vertex.java.lang.ObjectgetSource(java.lang.Object directed_edge)Returns the source of a directed edge.java.util.CollectiongetSuccessors(java.lang.Object vertex)Returns the vertices that have an incoming edge from the given vertex.intgetVertexCount()java.util.CollectiongetVertices()Returns all vertices of the graph.booleanisDest(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the destination of the edge.booleanisSource(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the source of the edge.booleanremoveEdge(java.lang.Object edge)Removes a edge from the graph.booleanremoveVertex(java.lang.Object vertex)Removes a vertex from the graph.- 
Methods inherited from class edu.uci.ics.jung.graph.AbstractGraphaddEdge, addEdge, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
- 
 
- 
- 
- 
Field Detail- 
INCOMINGprotected static final int INCOMING Indicates incoming edges in the map- See Also:
- Constant Field Values
 
 - 
OUTGOINGprotected static final int OUTGOING Indicates outgoing edges in the map- See Also:
- Constant Field Values
 
 - 
INCIDENTprotected static final int INCIDENT Indicates incident (undirected) edges in the map- See Also:
- Constant Field Values
 
 - 
mvertex_mapsprotected java.util.Map mvertex_maps Map of vertices to adjacency maps of vertices to {incoming, outgoing, incident} edges
 - 
mdirected_edgesprotected java.util.Map mdirected_edges Map of directed edges to incident vertex sets
 - 
mundirected_edgesprotected java.util.Map mundirected_edges Map of undirected edges to incident vertex sets
 
- 
 - 
Method Detail- 
getFactorypublic static org.apache.commons.collections15.Factory getFactory() Returns the factory for the graph.- Returns:
- The Factory for the graph..
 - 
createpublic static edu.uci.ics.jung.graph.Graph create() Returns a new MultidirectedMultiGraph.- Returns:
- The MultidirectedMultiGraph.
 - 
addEdgepublic boolean addEdge(java.lang.Object edge, edu.uci.ics.jung.graph.util.Pair endpoints)Adds a directed edge to the graph.- Overrides:
- addEdgein class- edu.uci.ics.jung.graph.AbstractGraph
- Parameters:
- edge- The edge.
- endpoints- The endpoints.
- Returns:
- trueif success.
 
 - 
addEdgepublic 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.- Overrides:
- addEdgein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edge- The edge.
- endpoints- The endpoints.
- edgeType- The edge type.
- Returns:
- trueif success.
 
 - 
addEdgepublic boolean addEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)Adds a directed edge to the graph.- Specified by:
- addEdgein interface- edu.uci.ics.jung.graph.Graph
- Overrides:
- addEdgein class- edu.uci.ics.jung.graph.AbstractGraph
- Parameters:
- edge- The edge.
- v1- The first vertex.
- v2- The second vertex.
- Returns:
- trueif success.
 
 - 
addEdgepublic 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.- Specified by:
- addEdgein interface- edu.uci.ics.jung.graph.Graph
- Overrides:
- addEdgein class- edu.uci.ics.jung.graph.AbstractGraph
- Parameters:
- edge- The edge.
- v1- The first vertex.
- v2- The second vertex..
- edgeType- The edge type.
- Returns:
- trueif success.
 
 - 
findEdgepublic java.lang.Object findEdge(java.lang.Object v1, java.lang.Object v2)Returns the first edge between the two vertices.- Specified by:
- findEdgein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- findEdgein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- v1- The first vertex.
- v2- The second vertex.
- Returns:
- The edge or nullif there is no incident edge between the vertices.
 
 - 
findEdgeSetpublic java.util.Collection findEdgeSet(java.lang.Object v1, java.lang.Object v2)Returns a collection of edges between the two vertices.- Specified by:
- findEdgeSetin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- findEdgeSetin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- v1- The first vertex.
- v2- The second vertex.
- Returns:
- The collection of edges or nullif there is no incident edge between the vertices.
 
 - 
getInEdgespublic java.util.Collection getInEdges(java.lang.Object vertex) Returns the incoming edges of the vertex.- Specified by:
- getInEdgesin interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getInEdgesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getInEdgesin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertx
- Returns:
- The collection of edges.
 
 - 
getOutEdgespublic java.util.Collection getOutEdges(java.lang.Object vertex) Returns the outgoing edges of the vertex.- Specified by:
- getOutEdgesin interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getOutEdgesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getOutEdgesin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertx
- Returns:
- The collection of edges.
 
 - 
getPredecessorspublic java.util.Collection getPredecessors(java.lang.Object vertex) Returns the vertices that have an outgoing edge to the given vertex.- Specified by:
- getPredecessorsin interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getPredecessorsin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getPredecessorsin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- The collection of vertices.
 
 - 
getSuccessorspublic java.util.Collection getSuccessors(java.lang.Object vertex) Returns the vertices that have an incoming edge from the given vertex.- Specified by:
- getSuccessorsin interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getSuccessorsin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getSuccessorsin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- The collection of vertices.
 
 - 
getEdgespublic java.util.Collection getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType) Returns the edges for a given edge type.- Specified by:
- getEdgesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getEdgesin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edgeType- The edge tzpe.
- Returns:
- The collection of edges.
 
 - 
getEndpointspublic edu.uci.ics.jung.graph.util.Pair getEndpoints(java.lang.Object edge) Returns the endpoints of the edge.- Specified by:
- getEndpointsin interface- edu.uci.ics.jung.graph.Graph
- Overrides:
- getEndpointsin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edge- The edge.
- Returns:
- The endpoints.
 
 - 
getEdgeTypepublic edu.uci.ics.jung.graph.util.EdgeType getEdgeType(java.lang.Object edge) Returns the edge type of en edge.- Specified by:
- getEdgeTypein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getEdgeTypein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edge- The edge.
- Returns:
- The edge type.
 
 - 
getSourcepublic java.lang.Object getSource(java.lang.Object directed_edge) Returns the source of a directed edge.- Specified by:
- getSourcein interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getSourcein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getSourcein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- directed_edge- The edge.
- Returns:
- The vertex.
 
 - 
getDestpublic java.lang.Object getDest(java.lang.Object directed_edge) Returns the destination of a directed edge.- Specified by:
- getDestin interface- edu.uci.ics.jung.graph.Graph
- Specified by:
- getDestin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getDestin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- directed_edge- The edge.
- Returns:
- The vertex.
 
 - 
isSourcepublic boolean isSource(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the source of the edge.- Specified by:
- isSourcein interface- edu.uci.ics.jung.graph.Graph
- Overrides:
- isSourcein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- edge- The edge.
- Returns:
- trueif the vertex is the source.
 
 - 
isDestpublic boolean isDest(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the destination of the edge.- Specified by:
- isDestin interface- edu.uci.ics.jung.graph.Graph
- Overrides:
- isDestin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- edge- The edge.
- Returns:
- trueif the vertex is the destination.
 
 - 
getEdgespublic java.util.Collection getEdges() Returns all edges of the graph.- Specified by:
- getEdgesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getEdgesin class- edu.uci.ics.jung.graph.SparseGraph
- Returns:
- The collection of edges.
 
 - 
getVerticespublic java.util.Collection getVertices() Returns all vertices of the graph.- Specified by:
- getVerticesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getVerticesin class- edu.uci.ics.jung.graph.SparseGraph
- Returns:
- The collection of vertices.
 
 - 
containsVertexpublic boolean containsVertex(java.lang.Object vertex) Returnstrueif the graph contains the vertex.- Specified by:
- containsVertexin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- containsVertexin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- trueif the vertex is in the graph.
 
 - 
containsEdgepublic boolean containsEdge(java.lang.Object edge) Returnstrueif the graph contains the edge.- Specified by:
- containsEdgein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- containsEdgein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edge- The edge.
- Returns:
- trueif the edge is in the graph.
 
 - 
getEdgeCountpublic int getEdgeCount() - Specified by:
- getEdgeCountin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getEdgeCountin class- edu.uci.ics.jung.graph.SparseGraph
- Returns:
- The edge count.
 
 - 
getVertexCountpublic int getVertexCount() - Specified by:
- getVertexCountin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getVertexCountin class- edu.uci.ics.jung.graph.SparseGraph
- Returns:
- The vertex count.
 
 - 
getNeighborspublic java.util.Collection getNeighbors(java.lang.Object vertex) Returns the neighbor vertices of a given vertex.- Specified by:
- getNeighborsin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getNeighborsin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- The collection of neighbors.
 
 - 
degreepublic int degree(java.lang.Object vertex) Returns the degree (number of incident edges) of a vertex.- Specified by:
- degreein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- degreein class- edu.uci.ics.jung.graph.AbstractGraph
- Parameters:
- vertex- The vertex.
- Returns:
- The degree.
 
 - 
getIncidentEdgespublic java.util.Collection getIncidentEdges(java.lang.Object vertex) Returns the incident edges of the vertex.- Specified by:
- getIncidentEdgesin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- getIncidentEdgesin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- The collection of edges.
 
 - 
addVertexpublic boolean addVertex(java.lang.Object vertex) Adds a vertex to the graph.- Specified by:
- addVertexin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- addVertexin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- trueif success.
 
 - 
removeVertexpublic boolean removeVertex(java.lang.Object vertex) Removes a vertex from the graph.- Specified by:
- removeVertexin interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- removeVertexin class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- vertex- The vertex.
- Returns:
- trueif success
 
 - 
removeEdgepublic boolean removeEdge(java.lang.Object edge) Removes a edge from the graph.- Specified by:
- removeEdgein interface- edu.uci.ics.jung.graph.Hypergraph
- Overrides:
- removeEdgein class- edu.uci.ics.jung.graph.SparseGraph
- Parameters:
- edge- The edge.
- Returns:
- trueif success
 
 - 
getIncoming_internalprotected java.util.Collection getIncoming_internal(java.lang.Object vertex) Returns the incoming edges of the vertex- Parameters:
- vertex- The vertex.
- Returns:
- The collection of edges.
 
 - 
getIncident_internalprotected java.util.Collection getIncident_internal(java.lang.Object vertex) Returns the incident edges of the vertex- Parameters:
- vertex- The vertex.
- Returns:
- The collection of edges.
 
 - 
getOutgoing_internalprotected java.util.Collection getOutgoing_internal(java.lang.Object vertex) Returns the outgoing edges of the vertex- Parameters:
- vertex- The vertex.
- Returns:
- The collection of edges.
 
 
 
 
- 
 
-