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.GraphA 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.GraphdelegateThe delegated graphprotected java.util.Mapedge_elemetsThe map of edge elementsprotected org.apache.commons.collections15.Factoryedge_factoryFactories for edgesprotected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedListedge_weightsThe edge weights is the number of edge elements contained in the edge.protected java.util.Mapvertex_elemetsThe map of vertex elementsprotected org.apache.commons.collections15.Factoryvertex_factoryFactoriy for verticesprotected jadex.tools.comanalyzer.graph.ComponentGroupMultiGraph.GenericSortedListvertex_weightsThe vertex weights is the number of edges going in or out the vertex.
-
Constructor Summary
Constructors Modifier Constructor Description protectedComponentGroupMultiGraph(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 booleanaddEdge(java.lang.Object e, java.lang.Object v1, java.lang.Object v2)Adds an 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 an edge with a given edge type to the graph.booleanaddEdge(java.lang.Object edge, java.util.Collection vertices)Adds an edge to the graph.booleanaddEdge(java.lang.Object edge, java.util.Collection vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)Addsedgeto this graph with typeedge_type.booleanaddEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)Adds an directed edge element with given vertex elements to the graph.booleanaddEdgeElement(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.booleanaddVertex(java.lang.Object vertex)Adds a vertex to the graph.booleanaddVertexElement(java.lang.Object ve)Adds a new vertex containing the vertex element to the graph.booleanappendEdgeElement(java.lang.Object ee, java.lang.Object ve1, java.lang.Object ve2)Appends an directed edge element with given vertex elements to the graph.booleanappendEdgeElement(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.booleanappendVertexElement(java.lang.Object ve, java.lang.Object v)Append a vertex element to a vertex.voidclear()Clear all elements from the delegated graph and this graph.booleancontainsEdge(java.lang.Object edge)Returnstrueif the graph contains the edge.booleancontainsEdgeElement(java.lang.Object ee)Returnstrueif the graph contains the given edge element.booleancontainsVertex(java.lang.Object vertex)Returnstrueif the graph contains the vertex.booleancontainsVertexElement(java.lang.Object ve)Returnstrueif the graph contains the given vertex element.static ComponentGroupMultiGraphcreateInstance(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.intdegree(java.lang.Object vertex)Returns the degree (number of incident edges) of a vertex.IComponentGroupfindEdge(java.lang.Object ee)Returns the edge (group) for an edge element.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.IComponentGroupfindVertex(java.lang.Object ve)Returns the vertex (group) for a vertex element.java.util.CollectiongetAllEdgeElements()Returns all edge elements.java.util.CollectiongetAllVertexElements()Returns all vertex elements.edu.uci.ics.jung.graph.util.EdgeTypegetDefaultEdgeType()java.lang.ObjectgetDest(java.lang.Object directed_edge)Returns the destination of a directed edge.intgetEdgeCount()intgetEdgeCount(edu.uci.ics.jung.graph.util.EdgeType et)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.intgetHighestEdgeWeight()Returns the highest edge weightintgetHighestVertexWeight()Returns the highest vertex weight.intgetIncidentCount(java.lang.Object edge)Returns 2 if the edge has two different endpoints.java.util.CollectiongetIncidentEdges(java.lang.Object vertex)Returns the incident edges of the vertex.java.util.CollectiongetIncidentVertices(java.lang.Object edge)java.util.CollectiongetInEdges(java.lang.Object vertex)Returns the incoming edges of the vertex.intgetNeighborCount(java.lang.Object vertex)Returns the neighbor count.java.util.CollectiongetNeighbors(java.lang.Object vertex)Returns the neighbor vertices of a given vertex.java.lang.ObjectgetOpposite(java.lang.Object vertex, java.lang.Object edge)Returns the other endpoint of the edge.java.util.CollectiongetOutEdges(java.lang.Object vertex)Returns the outgoing edges of the vertex.intgetPredecessorCount(java.lang.Object vertex)Returns the number of vertices that have an outgoing edge to the given vertex.java.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.intgetSuccessorCount(java.lang.Object vertex)Returns the number of vertices that have an incoming edge from the given vertex.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.intinDegree(java.lang.Object vertex)Returns the count of incoming edges to the vertex.booleanisDest(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the destination of the edge.booleanisIncident(java.lang.Object vertex, java.lang.Object edge)Returnstrueifvertexandedgeare incident to each other.booleanisNeighbor(java.lang.Object v1, java.lang.Object v2)Returnstrueifv1andv2share an incident edge.booleanisPredecessor(java.lang.Object v1, java.lang.Object v2)Returnstrueif there is an edge from first vertex to the second vertex.booleanisSource(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the source of the edge.booleanisSuccessor(java.lang.Object v1, java.lang.Object v2)Returnstrueif there is an edge from second vertex to the first vertex.intoutDegree(java.lang.Object vertex)Returns the count of outgoing edges from the vertex.booleanremoveEdge(java.lang.Object edge)Removes an edge.booleanremoveEdgeElement(java.lang.Object ee)Removes an edge element from the graph.booleanremoveVertex(java.lang.Object vertex)Removes a vertex.booleanremoveVertexElement(java.lang.Object ve)Removes a vertex element from the graph.java.lang.StringtoString()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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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)
Returnstrueif the graph contains the given edge element.- Parameters:
ee- The edge element to query- Returns:
trueif present
-
containsVertexElement
public boolean containsVertexElement(java.lang.Object ve)
Returnstrueif the graph contains the given vertex element.- Parameters:
ve- The vertex element to query- Returns:
trueif success
-
removeEdgeElement
public boolean removeEdgeElement(java.lang.Object ee)
Removes an edge element from the graph.- Parameters:
ee- The edge element to remove- Returns:
trueif success.
-
removeVertexElement
public boolean removeVertexElement(java.lang.Object ve)
Removes a vertex element from the graph.- Parameters:
ve- The vertex element to remove- Returns:
trueif 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:
addEdgein interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
edge- The edge.vertices- A collection of veritexes. The size of the Collection must be 2.- Returns:
trueif 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:
addEdgein interfaceedu.uci.ics.jung.graph.Graph- Parameters:
e- The edge.v1- The first vertex.v2- The second vertex.edgeType- The edge type.- Returns:
trueif success.
-
addEdge
public boolean addEdge(java.lang.Object edge, java.util.Collection vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)Addsedgeto this graph with typeedge_type. Fails under the following circumstances:- edge is already an element of the graph
- edge or
verticesisnull - 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:
addEdgein interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
edge-vertices-- Returns:
trueif the add is successful, andfalseotherwise- Throws:
java.lang.IllegalArgumentException- ifedgeorverticesis null, or if a different vertex set in this graph is already connected byedge, or ifverticesare 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:
addEdgein interfaceedu.uci.ics.jung.graph.Graph- Parameters:
e- The edge.v1- The first vertex.v2- The second vertex.- Returns:
trueif success.
-
addVertex
public boolean addVertex(java.lang.Object vertex)
Adds a vertex to the graph.- Specified by:
addVertexin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
vertex- The vertex.- Returns:
trueif success.
-
removeEdge
public boolean removeEdge(java.lang.Object edge)
Removes an edge.- Specified by:
removeEdgein interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
edge- The edge to remove.- Returns:
trueif success.
-
removeVertex
public boolean removeVertex(java.lang.Object vertex)
Removes a vertex.- Specified by:
removeVertexin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
vertex- The vertex.- Returns:
trueif success.
-
isIncident
public boolean isIncident(java.lang.Object vertex, java.lang.Object edge)Returnstrueifvertexandedgeare incident to each other. Equivalent togetIncidentEdges(vertex).contains(edge)and togetIncidentVertices(edge).contains(vertex).- Specified by:
isIncidentin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
vertex-edge-- Returns:
trueifvertexandedgeare incident to each other
-
isNeighbor
public boolean isNeighbor(java.lang.Object v1, java.lang.Object v2)Returnstrueifv1andv2share an incident edge. Equivalent togetNeighbors(v1).contains(v2).- Specified by:
isNeighborin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
v1- the first vertex to testv2- the second vertex to test- Returns:
trueifv1andv2share an incident edge
-
containsEdge
public boolean containsEdge(java.lang.Object edge)
Returnstrueif the graph contains the edge.- Specified by:
containsEdgein interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
edge- The edge.- Returns:
trueif the edge is in the graph.
-
containsVertex
public boolean containsVertex(java.lang.Object vertex)
Returnstrueif the graph contains the vertex.- Specified by:
containsVertexin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
vertex- The vertex.- Returns:
trueif 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:
degreein 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:
findEdgein interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
v1- The first vertex.v2- The second vertex.- Returns:
- The edge or
nullif 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:
findEdgeSetin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
v1- The first vertex.v2- The second vertex.- Returns:
- The collection of edges or
nullif 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:
getDestin interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getDestin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
directed_edge- The edge.- Returns:
- The vertex.
-
getEdgeCount
public int getEdgeCount()
- Specified by:
getEdgeCountin interfaceedu.uci.ics.jung.graph.Hypergraph- Returns:
- The edge count.
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType et)
- Specified by:
getEdgeCountin interfaceedu.uci.ics.jung.graph.Hypergraph- Returns:
- The edge count.
-
getEdges
public java.util.Collection getEdges()
Returns all edges of the graph.- Specified by:
getEdgesin 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:
getEdgesin 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:
getEdgeTypein 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:
getEndpointsin 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:
getIncidentCountin 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:
getIncidentEdgesin 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:
getIncidentVerticesin 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:
getInEdgesin interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getInEdgesin 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:
getNeighborCountin 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:
getNeighborsin 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:
getOppositein 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:
getOutEdgesin interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getOutEdgesin 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:
getPredecessorCountin 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:
getPredecessorsin interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getPredecessorsin 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:
getSourcein interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getSourcein 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:
getSuccessorCountin 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:
getSuccessorsin interfaceedu.uci.ics.jung.graph.Graph- Specified by:
getSuccessorsin interfaceedu.uci.ics.jung.graph.Hypergraph- Parameters:
vertex- The vertex.- Returns:
- The collection of vertices.
-
getVertexCount
public int getVertexCount()
- Specified by:
getVertexCountin interfaceedu.uci.ics.jung.graph.Hypergraph- Returns:
- The vertex count.
-
getVertices
public java.util.Collection getVertices()
Returns all vertices of the graph.- Specified by:
getVerticesin 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:
inDegreein interfaceedu.uci.ics.jung.graph.Graph- Specified by:
inDegreein 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)Returnstrueif the vertex is the destination of the edge.- Specified by:
isDestin interfaceedu.uci.ics.jung.graph.Graph- Parameters:
vertex- The vertex.edge- The edge.- Returns:
trueif the vertex is the destination.
-
isPredecessor
public boolean isPredecessor(java.lang.Object v1, java.lang.Object v2)Returnstrueif there is an edge from first vertex to the second vertex.- Specified by:
isPredecessorin interfaceedu.uci.ics.jung.graph.Graph- Parameters:
v1- The first vertex.v2- The second vertex.- Returns:
trueif the first vertex is predecessor of the second vertex.
-
isSource
public boolean isSource(java.lang.Object vertex, java.lang.Object edge)Returnstrueif the vertex is the source of the edge.- Specified by:
isSourcein interfaceedu.uci.ics.jung.graph.Graph- Parameters:
vertex- The vertex.edge- The edge.- Returns:
trueif the vertex is the source.
-
isSuccessor
public boolean isSuccessor(java.lang.Object v1, java.lang.Object v2)Returnstrueif there is an edge from second vertex to the first vertex.- Specified by:
isSuccessorin interfaceedu.uci.ics.jung.graph.Graph- Parameters:
v1- The first vertex.v2- The second vertex.- Returns:
trueif 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:
outDegreein interfaceedu.uci.ics.jung.graph.Graph- Specified by:
outDegreein 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:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
- Specified by:
getDefaultEdgeTypein interfaceedu.uci.ics.jung.graph.Hypergraph
- edge or
-
-