Package ghidra.graph.jung
Class JungToGDirectedGraphAdapter<V,E extends GEdge<V>>
java.lang.Object
ghidra.graph.jung.JungToGDirectedGraphAdapter<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
GDirectedGraph<V,
,E> GImplicitDirectedGraph<V,
E>
public class JungToGDirectedGraphAdapter<V,E extends GEdge<V>>
extends Object
implements GDirectedGraph<V,E>
A class that turns a
Graph
into a GDirectedGraph
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an edgeboolean
addEdge
(E edge, Collection<? extends V> vertices) boolean
addEdge
(E edge, Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type) boolean
boolean
boolean
Add a vertexboolean
containsEdge
(E edge) Test if the graph contains a given edgeboolean
containsEdge
(V from, V to) Test if the graph contains an edge from one given vertex to anotherboolean
containsVertex
(V vertex) Test if the graph contains a given vertexcopy()
Copy this graph.int
Creates a new instance of this graph with no vertices or edges.Locates the edge object for the two verticesfindEdgeSet
(V v1, V v2) edu.uci.ics.jung.graph.util.EdgeType
int
Count the number of edges in the graphint
getEdgeCount
(edu.uci.ics.jung.graph.util.EdgeType edge_type) getEdges()
Retrieve all the edgesgetEdges
(edu.uci.ics.jung.graph.util.EdgeType edge_type) edu.uci.ics.jung.graph.util.EdgeType
getEdgeType
(E edge) edu.uci.ics.jung.graph.util.Pair
<V> getEndpoints
(E edge) int
getIncidentCount
(E edge) getIncidentEdges
(V vertex) Returns all edges connected to the given vertexgetIncidentVertices
(E edge) getInEdges
(V vertex) Compute the incident edges that end at the given vertexint
getNeighborCount
(V vertex) getNeighbors
(V vertex) getOpposite
(V vertex, E edge) getOutEdges
(V vertex) Compute the incident edges that start at the given vertexint
getPredecessorCount
(V vertex) getPredecessors
(V vertex) Compute a vertex's predecessorsint
getSuccessorCount
(V vertex) getSuccessors
(V vertex) Compute a vertex's successorsint
Count the number of vertices in the graphRetrieve all the verticesint
boolean
boolean
isEmpty()
Test if the graph is empty, i.e., contains no vertices or edgesboolean
isIncident
(V vertex, E edge) boolean
isNeighbor
(V v1, V v2) boolean
isPredecessor
(V v1, V v2) boolean
boolean
isSuccessor
(V v1, V v2) int
boolean
removeEdge
(E edge) Removes an edgevoid
removeEdges
(Iterable<E> edges) Removes the given edges from the graphboolean
removeVertex
(V vertex) Remove a vertexvoid
removeVertices
(Iterable<V> vertices) Removes the given vertices from the graph
-
Constructor Details
-
JungToGDirectedGraphAdapter
-
-
Method Details
-
addEdge
Description copied from interface:GDirectedGraph
Add an edge -
containsEdge
Description copied from interface:GDirectedGraph
Test if the graph contains an edge from one given vertex to another- Specified by:
containsEdge
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
from
- the source vertexto
- the destination vertex- Returns:
- true if such an edge exists, or false
-
emptyCopy
Description copied from interface:GDirectedGraph
Creates a new instance of this graph with no vertices or edges. This is useful when you wish to build a new graph using the same type as this graph. -
copy
Description copied from interface:GDirectedGraph
Copy this graph.Note: the vertices and edges in the copy may be the same instances in the new graph and not themselves copies.
-
isEmpty
public boolean isEmpty()Description copied from interface:GDirectedGraph
Test if the graph is empty, i.e., contains no vertices or edges -
getEdges
Description copied from interface:GDirectedGraph
Retrieve all the edges -
getInEdges
Description copied from interface:GDirectedGraph
Compute the incident edges that end at the given vertex- Specified by:
getInEdges
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Specified by:
getInEdges
in interfaceGImplicitDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the destination vertex- Returns:
- the in-edges to the given vertex
-
getVertices
Description copied from interface:GDirectedGraph
Retrieve all the vertices- Specified by:
getVertices
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Returns:
- the vertices
-
getOutEdges
Description copied from interface:GDirectedGraph
Compute the incident edges that start at the given vertex- Specified by:
getOutEdges
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Specified by:
getOutEdges
in interfaceGImplicitDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the source vertex- Returns:
- the out-edges from the given vertex
-
containsVertex
Description copied from interface:GDirectedGraph
Test if the graph contains a given vertex- Specified by:
containsVertex
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the vertex- Returns:
- true if the vertex is in the graph, or false
-
getPredecessors
Description copied from interface:GDirectedGraph
Compute a vertex's predecessorsThe default implementation computes this from the in-edges
- Specified by:
getPredecessors
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Specified by:
getPredecessors
in interfaceGImplicitDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the destination vertex- Returns:
- the predecessors
-
containsEdge
Description copied from interface:GDirectedGraph
Test if the graph contains a given edge- Specified by:
containsEdge
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
edge
- the ege- Returns:
- true if the edge is in the graph, or false
-
getEdgeCount
public int getEdgeCount()Description copied from interface:GDirectedGraph
Count the number of edges in the graph- Specified by:
getEdgeCount
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Returns:
- the count
-
getSuccessors
Description copied from interface:GDirectedGraph
Compute a vertex's successorsThe default implementation compute this from the out-edges
- Specified by:
getSuccessors
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Specified by:
getSuccessors
in interfaceGImplicitDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the source vertex- Returns:
- the successors
-
getVertexCount
public int getVertexCount()Description copied from interface:GDirectedGraph
Count the number of vertices in the graph- Specified by:
getVertexCount
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Returns:
- the count
-
getNeighbors
-
inDegree
-
getIncidentEdges
Description copied from interface:GDirectedGraph
Returns all edges connected to the given vertex- Specified by:
getIncidentEdges
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the vertex- Returns:
- the edges
-
outDegree
-
getIncidentVertices
-
isPredecessor
-
isSuccessor
-
findEdge
Description copied from interface:GDirectedGraph
Locates the edge object for the two vertices -
getPredecessorCount
-
getSuccessorCount
-
getSource
-
findEdgeSet
-
getDest
-
isSource
-
addVertex
Description copied from interface:GDirectedGraph
Add a vertex -
isDest
-
addEdge
-
addEdge
-
addEdge
public boolean addEdge(E edge, Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type) -
addEdge
-
removeVertex
Description copied from interface:GDirectedGraph
Remove a vertex- Specified by:
removeVertex
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertex
- the vertex- Returns:
- true
-
removeVertices
Description copied from interface:GDirectedGraph
Removes the given vertices from the graph- Specified by:
removeVertices
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
vertices
- the vertices to remove
-
removeEdges
Description copied from interface:GDirectedGraph
Removes the given edges from the graph- Specified by:
removeEdges
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
edges
- the edges to remove
-
getEndpoints
-
getOpposite
-
removeEdge
Description copied from interface:GDirectedGraph
Removes an edge- Specified by:
removeEdge
in interfaceGDirectedGraph<V,
E extends GEdge<V>> - Parameters:
edge
- the edge- Returns:
- true if the graph contained the given edge
-
isNeighbor
-
isIncident
-
degree
-
getNeighborCount
-
getIncidentCount
-
getEdgeType
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType() -
getEdges
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)
-