Package jadex.tools.comanalyzer.graph
Class ComponentGroupMultiGraph
- java.lang.Object
-
- jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.Graph
,edu.uci.ics.jung.graph.Hypergraph
public class ComponentGroupMultiGraph extends java.lang.Object implements edu.uci.ics.jung.graph.Graph
A generic Graph with edges and vertices consisting of groups of elements. The elements are in a container that inplements the IComponentGroup interface. (You cant use simply List because the edges and vertices are stored in HashMaps and Lists changes their hashcode when elements are added or removed. The List is no longer to be found in the HashMap) Edge- and vertex element are stored in this component while the vertices and edges are delegated to a different graph. This implementation provides acces to either the elements and (per delegate) to the vertex and edges of the graph.-
-
Field Summary
Fields Modifier and Type Field Description protected edu.uci.ics.jung.graph.Graph
delegate
The delegated graphprotected java.util.Map
edge_elemets
The map of edge elementsprotected org.apache.commons.collections15.Factory
edge_factory
Factories for edgesprotected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList
edge_weights
The edge weights is the number of edge elements contained in the edge.protected java.util.Map
vertex_elemets
The map of vertex elementsprotected org.apache.commons.collections15.Factory
vertex_factory
Factoriy for verticesprotected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList
vertex_weights
The vertex weights is the number of edges going in or out the vertex.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComponentGroupMultiGraph(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)
Adds an 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 an edge with a given edge type to the graph.boolean
addEdge(java.lang.Object edge, java.util.Collection vertices)
Adds an edge to the graph.boolean
addEdge(java.lang.Object edge, java.util.Collection vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)
Addsedge
to this graph with typeedge_type
.boolean
addEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
Adds an directed edge element with given vertex elements to the graph.boolean
addEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Adds an edge element with given vertex elements and edge type to the graph.boolean
addVertex(java.lang.Object vertex)
Adds a vertex to the graph.boolean
addVertexElement(java.lang.Object ve)
Adds a new vertex containing the vertex element to the graph.boolean
appendEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
Appends an directed edge element with given vertex elements to the graph.boolean
appendEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Appends an edge element with given vertex elements and edge type to the graph.boolean
appendVertexElement(java.lang.Object ve, java.lang.Object v)
Append a vertex element to a vertex.void
clear()
Clear all elements from the delegated graph and this graph.boolean
containsEdge(java.lang.Object edge)
Returnstrue
if the graph contains the edge.boolean
containsEdgeElement(java.lang.Object ee)
Returnstrue
if the graph contains the given edge element.boolean
containsVertex(java.lang.Object vertex)
Returnstrue
if the graph contains the vertex.boolean
containsVertexElement(java.lang.Object ve)
Returnstrue
if the graph contains the given vertex element.static ComponentGroupMultiGraph
createInstance(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
Factory method for the graph.int
degree(java.lang.Object vertex)
Returns the degree (number of incident edges) of a vertex.IComponentGroup
findEdge(java.lang.Object ee)
Returns the edge (group) for an edge element.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.IComponentGroup
findVertex(java.lang.Object ve)
Returns the vertex (group) for a vertex element.java.util.Collection
getAllEdgeElements()
Returns all edge elements.java.util.Collection
getAllVertexElements()
Returns all vertex elements.edu.uci.ics.jung.graph.util.EdgeType
getDefaultEdgeType()
java.lang.Object
getDest(java.lang.Object directed_edge)
Returns the destination of a directed edge.int
getEdgeCount()
int
getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType et)
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.int
getHighestEdgeWeight()
Returns the highest edge weightint
getHighestVertexWeight()
Returns the highest vertex weight.int
getIncidentCount(java.lang.Object edge)
Returns 2 if the edge has two different endpoints.java.util.Collection
getIncidentEdges(java.lang.Object vertex)
Returns the incident edges of the vertex.java.util.Collection
getIncidentVertices(java.lang.Object edge)
java.util.Collection
getInEdges(java.lang.Object vertex)
Returns the incoming edges of the vertex.int
getNeighborCount(java.lang.Object vertex)
Returns the neighbor count.java.util.Collection
getNeighbors(java.lang.Object vertex)
Returns the neighbor vertices of a given vertex.java.lang.Object
getOpposite(java.lang.Object vertex, java.lang.Object edge)
Returns the other endpoint of the edge.java.util.Collection
getOutEdges(java.lang.Object vertex)
Returns the outgoing edges of the vertex.int
getPredecessorCount(java.lang.Object vertex)
Returns the number of vertices that have an outgoing edge to the given 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.int
getSuccessorCount(java.lang.Object vertex)
Returns the number of vertices that have an incoming edge from the given vertex.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.int
inDegree(java.lang.Object vertex)
Returns the count of incoming edges to the vertex.boolean
isDest(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
if the vertex is the destination of the edge.boolean
isIncident(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
ifvertex
andedge
are incident to each other.boolean
isNeighbor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
ifv1
andv2
share an incident edge.boolean
isPredecessor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
if there is an edge from first vertex to the second vertex.boolean
isSource(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
if the vertex is the source of the edge.boolean
isSuccessor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
if there is an edge from second vertex to the first vertex.int
outDegree(java.lang.Object vertex)
Returns the count of outgoing edges from the vertex.boolean
removeEdge(java.lang.Object edge)
Removes an edge.boolean
removeEdgeElement(java.lang.Object ee)
Removes an edge element from the graph.boolean
removeVertex(java.lang.Object vertex)
Removes a vertex.boolean
removeVertexElement(java.lang.Object ve)
Removes a vertex element from the graph.java.lang.String
toString()
Text representation for this graph
-
-
-
Field Detail
-
vertex_factory
protected org.apache.commons.collections15.Factory vertex_factory
Factoriy for vertices
-
edge_factory
protected org.apache.commons.collections15.Factory edge_factory
Factories for edges
-
edge_elemets
protected java.util.Map edge_elemets
The map of edge elements
-
vertex_elemets
protected java.util.Map vertex_elemets
The map of vertex elements
-
delegate
protected edu.uci.ics.jung.graph.Graph delegate
The delegated graph
-
edge_weights
protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList edge_weights
The edge weights is the number of edge elements contained in the edge. The list is sorted that the edge with the highest number of elements is at the end of the list. The highest edge weight is therefore identified by accessing the last element of the list.
-
vertex_weights
protected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedList vertex_weights
The vertex weights is the number of edges going in or out the vertex. The list is sorted that the vertex with the highest number of incident edges is at the end of the list. The highest vertex weight is therefore identified by accessing the last element of the list
-
-
Constructor Detail
-
ComponentGroupMultiGraph
protected ComponentGroupMultiGraph(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
The constructor. Besides the delegated graph, you must provide factories for the vertex and edges, since its not possible to instantiate type bound parameter (at least not that easy)- Parameters:
vertex_factory
- The factory for vertices.edge_factory
- The factory for edges.delegate
- The delegated graph.
-
-
Method Detail
-
createInstance
public static ComponentGroupMultiGraph createInstance(org.apache.commons.collections15.Factory vertex_factory, org.apache.commons.collections15.Factory edge_factory, edu.uci.ics.jung.graph.Graph delegate)
Factory method for the graph.- Parameters:
vertex_factory
- The factory for vertices.edge_factory
- The factory for edges.delegate
- The delegated graph.- Returns:
- The ComponentGroupMultiGraph.
-
clear
public void clear()
Clear all elements from the delegated graph and this graph.
-
addVertexElement
public boolean addVertexElement(java.lang.Object ve)
Adds a new vertex containing the vertex element to the graph.- Parameters:
ve
- The vertex element to add.- Returns:
true
if success.
-
appendVertexElement
public boolean appendVertexElement(java.lang.Object ve, java.lang.Object v)
Append a vertex element to a vertex.- Parameters:
ve
- The vertex element to append.v
- The vertex the element is append to.- Returns:
true
if success.
-
addEdgeElement
public boolean addEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Adds an edge element with given vertex elements and edge type to the graph. If the two vertex elements are already part of vertices, a new edge between these vertices is added. If the vertex elements dont already exist in the graph, new vertices are created. A new edge is created in any case.- Returns:
true
if success.
-
addEdgeElement
public boolean addEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
Adds an directed edge element with given vertex elements to the graph. If the two vertex elements are already part of vertices, a new edge between these vertices is added. If the vertex elements dont already exist in the graph, new vertices are created. A new edge is created in any case.- Returns:
true
if success.
-
appendEdgeElement
public boolean appendEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)
Appends an directed edge element with given vertex elements to the graph. If the two vertex elements are already part of vertices, and these vertices have a connection, the edge element is appended to this edge. Otherwise the components are added as new edge and new vertices to the graph.- Returns:
true
if success.
-
appendEdgeElement
public boolean appendEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Appends an edge element with given vertex elements and edge type to the graph. If the two vertex elements are already part of vertices, and these vertices have a connection, the edge element is appended to this edge. Otherwise the components are added as a new edge and new vertices to the graph. The type of the edge can be directed or undirected- Returns:
true
if success.
-
findEdge
public IComponentGroup findEdge(java.lang.Object ee)
Returns the edge (group) for an edge element.- Parameters:
ee
- The edge element to find.- Returns:
- The edge for this element.
-
findVertex
public IComponentGroup findVertex(java.lang.Object ve)
Returns the vertex (group) for a vertex element.- Parameters:
ve
- The vertex element to find- Returns:
- The vertex for this element.
-
containsEdgeElement
public boolean containsEdgeElement(java.lang.Object ee)
Returnstrue
if the graph contains the given edge element.- Parameters:
ee
- The edge element to query- Returns:
true
if present
-
containsVertexElement
public boolean containsVertexElement(java.lang.Object ve)
Returnstrue
if the graph contains the given vertex element.- Parameters:
ve
- The vertex element to query- Returns:
true
if success
-
removeEdgeElement
public boolean removeEdgeElement(java.lang.Object ee)
Removes an edge element from the graph.- Parameters:
ee
- The edge element to remove- Returns:
true
if success.
-
removeVertexElement
public boolean removeVertexElement(java.lang.Object ve)
Removes a vertex element from the graph.- Parameters:
ve
- The vertex element to remove- Returns:
true
if success
-
getAllEdgeElements
public java.util.Collection getAllEdgeElements()
Returns all edge elements.- Returns:
- The collection of all edge elements.
-
getAllVertexElements
public java.util.Collection getAllVertexElements()
Returns all vertex elements.- Returns:
- The collection of all vertex elements.
-
getHighestEdgeWeight
public int getHighestEdgeWeight()
Returns the highest edge weight- Returns:
- The highest weight of all edges.
-
getHighestVertexWeight
public int getHighestVertexWeight()
Returns the highest vertex weight.- Returns:
- The highest weight of all vertices.
-
addEdge
public boolean addEdge(java.lang.Object edge, java.util.Collection vertices)
Adds an edge to the graph.- Specified by:
addEdge
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
- The edge.vertices
- A collection of veritexes. The size of the Collection must be 2.- Returns:
true
if success.
-
addEdge
public boolean addEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Adds an edge with a given edge type to the graph.- Specified by:
addEdge
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
e
- The edge.v1
- The first vertex.v2
- The second vertex.edgeType
- The edge type.- Returns:
true
if success.
-
addEdge
public boolean addEdge(java.lang.Object edge, java.util.Collection vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)
Addsedge
to this graph with typeedge_type
. Fails under the following circumstances:- edge is already an element of the graph
- edge or
vertices
isnull
- vertices has the wrong number of vertices for the graph type
- vertices are already connected by another edge in this graph, and this graph does not accept parallel edges
- edge_type is not legal for this graph
- Specified by:
addEdge
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
-vertices
-- Returns:
true
if the add is successful, andfalse
otherwise- Throws:
java.lang.IllegalArgumentException
- ifedge
orvertices
is null, or if a different vertex set in this graph is already connected byedge
, or ifvertices
are not a legal vertex set foredge
-
addEdge
public boolean addEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)
Adds an directed edge to the graph.- Specified by:
addEdge
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
e
- The edge.v1
- The first vertex.v2
- The second vertex.- Returns:
true
if success.
-
addVertex
public boolean addVertex(java.lang.Object vertex)
Adds a vertex to the graph.- Specified by:
addVertex
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
true
if success.
-
removeEdge
public boolean removeEdge(java.lang.Object edge)
Removes an edge.- Specified by:
removeEdge
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
- The edge to remove.- Returns:
true
if success.
-
removeVertex
public boolean removeVertex(java.lang.Object vertex)
Removes a vertex.- Specified by:
removeVertex
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
true
if success.
-
isIncident
public boolean isIncident(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
ifvertex
andedge
are incident to each other. Equivalent togetIncidentEdges(vertex).contains(edge)
and togetIncidentVertices(edge).contains(vertex)
.- Specified by:
isIncident
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
-edge
-- Returns:
true
ifvertex
andedge
are incident to each other
-
isNeighbor
public boolean isNeighbor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
ifv1
andv2
share an incident edge. Equivalent togetNeighbors(v1).contains(v2)
.- Specified by:
isNeighbor
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
v1
- the first vertex to testv2
- the second vertex to test- Returns:
true
ifv1
andv2
share an incident edge
-
containsEdge
public boolean containsEdge(java.lang.Object edge)
Returnstrue
if the graph contains the edge.- Specified by:
containsEdge
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
- The edge.- Returns:
true
if the edge is in the graph.
-
containsVertex
public boolean containsVertex(java.lang.Object vertex)
Returnstrue
if the graph contains the vertex.- Specified by:
containsVertex
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
true
if the vertex is in the graph.
-
degree
public int degree(java.lang.Object vertex)
Returns the degree (number of incident edges) of a vertex.- Specified by:
degree
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The degree.
-
findEdge
public java.lang.Object findEdge(java.lang.Object v1, java.lang.Object v2)
Returns the first edge between the two vertices.- Specified by:
findEdge
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
v1
- The first vertex.v2
- The second vertex.- Returns:
- The edge or
null
if there is no incident edge between the vertices.
-
findEdgeSet
public java.util.Collection findEdgeSet(java.lang.Object v1, java.lang.Object v2)
Returns a collection of edges between the two vertices.- Specified by:
findEdgeSet
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
v1
- The first vertex.v2
- The second vertex.- Returns:
- The collection of edges or
null
if there is no incident edge between the vertices.
-
getDest
public java.lang.Object getDest(java.lang.Object directed_edge)
Returns the destination of a directed edge.- Specified by:
getDest
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getDest
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
directed_edge
- The edge.- Returns:
- The vertex.
-
getEdgeCount
public int getEdgeCount()
- Specified by:
getEdgeCount
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Returns:
- The edge count.
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType et)
- Specified by:
getEdgeCount
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Returns:
- The edge count.
-
getEdges
public java.util.Collection getEdges()
Returns all edges of the graph.- Specified by:
getEdges
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Returns:
- The collection of edges.
-
getEdges
public java.util.Collection getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)
Returns the edges for a given edge type.- Specified by:
getEdges
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edgeType
- The edge tzpe.- Returns:
- The collection of edges.
-
getEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(java.lang.Object edge)
Returns the edge type of en edge.- Specified by:
getEdgeType
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
- The edge.- Returns:
- The edge type.
-
getEndpoints
public edu.uci.ics.jung.graph.util.Pair getEndpoints(java.lang.Object edge)
Returns the endpoints of the edge.- Specified by:
getEndpoints
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
edge
- The edge.- Returns:
- The endpoints.
-
getIncidentCount
public int getIncidentCount(java.lang.Object edge)
Returns 2 if the edge has two different endpoints. If ist a loop the method returns 1.- Specified by:
getIncidentCount
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
edge
- The edge.- Returns:
- The incident count.
-
getIncidentEdges
public java.util.Collection getIncidentEdges(java.lang.Object vertex)
Returns the incident edges of the vertex.- Specified by:
getIncidentEdges
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The collection of edges.
-
getIncidentVertices
public java.util.Collection getIncidentVertices(java.lang.Object edge)
- Specified by:
getIncidentVertices
in interfaceedu.uci.ics.jung.graph.Hypergraph
-
getInEdges
public java.util.Collection getInEdges(java.lang.Object vertex)
Returns the incoming edges of the vertex.- Specified by:
getInEdges
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getInEdges
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertx- Returns:
- The collection of edges.
-
getNeighborCount
public int getNeighborCount(java.lang.Object vertex)
Returns the neighbor count.- Specified by:
getNeighborCount
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The count of neighbors.
-
getNeighbors
public java.util.Collection getNeighbors(java.lang.Object vertex)
Returns the neighbor vertices of a given vertex.- Specified by:
getNeighbors
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The collection of neighbors.
-
getOpposite
public java.lang.Object getOpposite(java.lang.Object vertex, java.lang.Object edge)
Returns the other endpoint of the edge.- Specified by:
getOpposite
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
vertex
- The vertex.edge
- The edge.- Returns:
- The opposit.
-
getOutEdges
public java.util.Collection getOutEdges(java.lang.Object vertex)
Returns the outgoing edges of the vertex.- Specified by:
getOutEdges
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getOutEdges
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertx- Returns:
- The collection of edges.
-
getPredecessorCount
public int getPredecessorCount(java.lang.Object vertex)
Returns the number of vertices that have an outgoing edge to the given vertex.- Specified by:
getPredecessorCount
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
vertex
- The vertex.- Returns:
- The predecessor count.
-
getPredecessors
public java.util.Collection getPredecessors(java.lang.Object vertex)
Returns the vertices that have an outgoing edge to the given vertex.- Specified by:
getPredecessors
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getPredecessors
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The collection of vertices.
-
getSource
public java.lang.Object getSource(java.lang.Object directed_edge)
Returns the source of a directed edge.- Specified by:
getSource
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getSource
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
directed_edge
- The edge.- Returns:
- The vertex.
-
getSuccessorCount
public int getSuccessorCount(java.lang.Object vertex)
Returns the number of vertices that have an incoming edge from the given vertex.- Specified by:
getSuccessorCount
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
vertex
- The vertex.- Returns:
- The successor count.
-
getSuccessors
public java.util.Collection getSuccessors(java.lang.Object vertex)
Returns the vertices that have an incoming edge from the given vertex.- Specified by:
getSuccessors
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
getSuccessors
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The collection of vertices.
-
getVertexCount
public int getVertexCount()
- Specified by:
getVertexCount
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Returns:
- The vertex count.
-
getVertices
public java.util.Collection getVertices()
Returns all vertices of the graph.- Specified by:
getVertices
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Returns:
- The collection of vertices.
-
inDegree
public int inDegree(java.lang.Object vertex)
Returns the count of incoming edges to the vertex.- Specified by:
inDegree
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
inDegree
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The incoming degree.
-
isDest
public boolean isDest(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
if the vertex is the destination of the edge.- Specified by:
isDest
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
vertex
- The vertex.edge
- The edge.- Returns:
true
if the vertex is the destination.
-
isPredecessor
public boolean isPredecessor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
if there is an edge from first vertex to the second vertex.- Specified by:
isPredecessor
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
v1
- The first vertex.v2
- The second vertex.- Returns:
true
if the first vertex is predecessor of the second vertex.
-
isSource
public boolean isSource(java.lang.Object vertex, java.lang.Object edge)
Returnstrue
if the vertex is the source of the edge.- Specified by:
isSource
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
vertex
- The vertex.edge
- The edge.- Returns:
true
if the vertex is the source.
-
isSuccessor
public boolean isSuccessor(java.lang.Object v1, java.lang.Object v2)
Returnstrue
if there is an edge from second vertex to the first vertex.- Specified by:
isSuccessor
in interfaceedu.uci.ics.jung.graph.Graph
- Parameters:
v1
- The first vertex.v2
- The second vertex.- Returns:
true
if the second vertex is successor of the fist vertex.
-
outDegree
public int outDegree(java.lang.Object vertex)
Returns the count of outgoing edges from the vertex.- Specified by:
outDegree
in interfaceedu.uci.ics.jung.graph.Graph
- Specified by:
outDegree
in interfaceedu.uci.ics.jung.graph.Hypergraph
- Parameters:
vertex
- The vertex.- Returns:
- The outgoing degree.
-
toString
public java.lang.String toString()
Text representation for this graph- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
- Specified by:
getDefaultEdgeType
in interfaceedu.uci.ics.jung.graph.Hypergraph
- edge or
-
-