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 type
  `E` - 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

  Constructors
  Constructor
  Description
  `JungToGDirectedGraphAdapter(edu.uci.ics.jung.graph.Graph<V,E> delegate)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addEdge(E e)`
  Add an edge
  `boolean`
  `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`
  `addEdge(E e, V v1, V v2)`
  `boolean`
  `addEdge(E e, V v1, V v2, edu.uci.ics.jung.graph.util.EdgeType edgeType)`
  `boolean`
  `addVertex(V vertex)`
  Add a vertex
  `boolean`
  `containsEdge(E edge)`
  Test if the graph contains a given edge
  `boolean`
  `containsEdge(V from, V to)`
  Test if the graph contains an edge from one given vertex to another
  `boolean`
  `containsVertex(V vertex)`
  Test if the graph contains a given vertex
  `GDirectedGraph<V,E>`
  `copy()`
  Copy this graph.
  `int`
  `degree(V vertex)`
  `GDirectedGraph<V,E>`
  `emptyCopy()`
  Creates a new instance of this graph with no vertices or edges.
  `E`
  `findEdge(V v1, V v2)`
  Locates the edge object for the two vertices
  `Collection<E>`
  `findEdgeSet(V v1, V v2)`
  `edu.uci.ics.jung.graph.util.EdgeType`
  `getDefaultEdgeType()`
  `V`
  `getDest(E directed_edge)`
  `int`
  `getEdgeCount()`
  Count the number of edges in the graph
  `int`
  `getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)`
  `Collection<E>`
  `getEdges()`
  Retrieve all the edges
  `Collection<E>`
  `getEdges(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)`
  `Collection<E>`
  `getIncidentEdges(V vertex)`
  Returns all edges connected to the given vertex
  `Collection<V>`
  `getIncidentVertices(E edge)`
  `Collection<E>`
  `getInEdges(V vertex)`
  Compute the incident edges that end at the given vertex
  `int`
  `getNeighborCount(V vertex)`
  `Collection<V>`
  `getNeighbors(V vertex)`
  `V`
  `getOpposite(V vertex, E edge)`
  `Collection<E>`
  `getOutEdges(V vertex)`
  Compute the incident edges that start at the given vertex
  `int`
  `getPredecessorCount(V vertex)`
  `Collection<V>`
  `getPredecessors(V vertex)`
  Compute a vertex's predecessors
  `V`
  `getSource(E directed_edge)`
  `int`
  `getSuccessorCount(V vertex)`
  `Collection<V>`
  `getSuccessors(V vertex)`
  Compute a vertex's successors
  `int`
  `getVertexCount()`
  Count the number of vertices in the graph
  `Collection<V>`
  `getVertices()`
  Retrieve all the vertices
  `int`
  `inDegree(V vertex)`
  `boolean`
  `isDest(V vertex, E edge)`
  `boolean`
  `isEmpty()`
  Test if the graph is empty, i.e., contains no vertices or edges
  `boolean`
  `isIncident(V vertex, E edge)`
  `boolean`
  `isNeighbor(V v1, V v2)`
  `boolean`
  `isPredecessor(V v1, V v2)`
  `boolean`
  `isSource(V vertex, E edge)`
  `boolean`
  `isSuccessor(V v1, V v2)`
  `int`
  `outDegree(V vertex)`
  `boolean`
  `removeEdge(E edge)`
  Removes an edge
  `void`
  `removeEdges(Iterable<E> edges)`
  Removes the given edges from the graph
  `boolean`
  `removeVertex(V vertex)`
  Remove a vertex
  `void`
  `removeVertices(Iterable<V> vertices)`
  Removes the given vertices from the graph

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JungToGDirectedGraphAdapter

    public JungToGDirectedGraphAdapter(edu.uci.ics.jung.graph.Graph<V,E> delegate)

- ## Method Details

  - ### addEdge

    public void addEdge(E e)
    Description copied from interface: `GDirectedGraph`
    Add an edge
    Specified by:
      `addEdge` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `e` - the edge

  - ### containsEdge

    public boolean containsEdge(V from, V to)
    Description copied from interface: `GDirectedGraph`
    Test if the graph contains an edge from one given vertex to another
    Specified by:
      `containsEdge` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `from` - the source vertex
      `to` - the destination vertex
    Returns:
      true if such an edge exists, or false

  - ### emptyCopy

    public GDirectedGraph<V,E> 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.
    Specified by:
      `emptyCopy` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the new copy

  - ### copy

    public GDirectedGraph<V,E> 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.

    Specified by:
      `copy` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Specified by:
      `copy` in interface `GImplicitDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the new copy

  - ### isEmpty

    public boolean isEmpty()
    Description copied from interface: `GDirectedGraph`
    Test if the graph is empty, i.e., contains no vertices or edges
    Specified by:
      `isEmpty` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      true if the graph is empty, or false

  - ### getEdges

    public Collection<E> getEdges()
    Description copied from interface: `GDirectedGraph`
    Retrieve all the edges
    Specified by:
      `getEdges` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the edges

  - ### getInEdges

    public Collection<E> getInEdges(V vertex)
    Description copied from interface: `GDirectedGraph`
    Compute the incident edges that end at the given vertex
    Specified by:
      `getInEdges` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Specified by:
      `getInEdges` in interface `GImplicitDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the destination vertex
    Returns:
      the in-edges to the given vertex

  - ### getVertices

    public Collection<V> getVertices()
    Description copied from interface: `GDirectedGraph`
    Retrieve all the vertices
    Specified by:
      `getVertices` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the vertices

  - ### getOutEdges

    public Collection<E> getOutEdges(V vertex)
    Description copied from interface: `GDirectedGraph`
    Compute the incident edges that start at the given vertex
    Specified by:
      `getOutEdges` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Specified by:
      `getOutEdges` in interface `GImplicitDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the source vertex
    Returns:
      the out-edges from the given vertex

  - ### containsVertex

    public boolean containsVertex(V vertex)
    Description copied from interface: `GDirectedGraph`
    Test if the graph contains a given vertex
    Specified by:
      `containsVertex` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the vertex
    Returns:
      true if the vertex is in the graph, or false

  - ### getPredecessors

    public Collection<V> getPredecessors(V vertex)
    Description copied from interface: `GDirectedGraph`
    Compute a vertex's predecessors

    The default implementation computes this from the in-edges

    Specified by:
      `getPredecessors` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Specified by:
      `getPredecessors` in interface `GImplicitDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the destination vertex
    Returns:
      the predecessors

  - ### containsEdge

    public boolean containsEdge(E edge)
    Description copied from interface: `GDirectedGraph`
    Test if the graph contains a given edge
    Specified by:
      `containsEdge` in interface `GDirectedGraph<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 interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the count

  - ### getSuccessors

    public Collection<V> getSuccessors(V vertex)
    Description copied from interface: `GDirectedGraph`
    Compute a vertex's successors

    The default implementation compute this from the out-edges

    Specified by:
      `getSuccessors` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Specified by:
      `getSuccessors` in interface `GImplicitDirectedGraph<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 interface `GDirectedGraph<V,E extends GEdge<V>>`
    Returns:
      the count

  - ### getNeighbors

    public Collection<V> getNeighbors(V vertex)

  - ### inDegree

    public int inDegree(V vertex)

  - ### getIncidentEdges

    public Collection<E> getIncidentEdges(V vertex)
    Description copied from interface: `GDirectedGraph`
    Returns all edges connected to the given vertex
    Specified by:
      `getIncidentEdges` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the vertex
    Returns:
      the edges

  - ### outDegree

    public int outDegree(V vertex)

  - ### getIncidentVertices

    public Collection<V> getIncidentVertices(E edge)

  - ### isPredecessor

    public boolean isPredecessor(V v1, V v2)

  - ### isSuccessor

    public boolean isSuccessor(V v1, V v2)

  - ### findEdge

    public E findEdge(V v1, V v2)
    Description copied from interface: `GDirectedGraph`
    Locates the edge object for the two vertices
    Specified by:
      `findEdge` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `v1` - the start vertex
      `v2` - the end vertex
    Returns:
      the edge

  - ### getPredecessorCount

    public int getPredecessorCount(V vertex)

  - ### getSuccessorCount

    public int getSuccessorCount(V vertex)

  - ### getSource

    public V getSource(E directed_edge)

  - ### findEdgeSet

    public Collection<E> findEdgeSet(V v1, V v2)

  - ### getDest

    public V getDest(E directed_edge)

  - ### isSource

    public boolean isSource(V vertex, E edge)

  - ### addVertex

    public boolean addVertex(V vertex)
    Description copied from interface: `GDirectedGraph`
    Add a vertex
    Specified by:
      `addVertex` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the vertex
    Returns:
      true if the add was successful, false otherwise

  - ### isDest

    public boolean isDest(V vertex, E edge)

  - ### addEdge

    public boolean addEdge(E edge, Collection<? extends V> vertices)

  - ### addEdge

    public boolean addEdge(E e, V v1, V v2)

  - ### addEdge

    public boolean addEdge(E edge, Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edge_type)

  - ### addEdge

    public boolean addEdge(E e, V v1, V v2, edu.uci.ics.jung.graph.util.EdgeType edgeType)

  - ### removeVertex

    public boolean removeVertex(V vertex)
    Description copied from interface: `GDirectedGraph`
    Remove a vertex
    Specified by:
      `removeVertex` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertex` - the vertex
    Returns:
      true

  - ### removeVertices

    public void removeVertices(Iterable<V> vertices)
    Description copied from interface: `GDirectedGraph`
    Removes the given vertices from the graph
    Specified by:
      `removeVertices` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `vertices` - the vertices to remove

  - ### removeEdges

    public void removeEdges(Iterable<E> edges)
    Description copied from interface: `GDirectedGraph`
    Removes the given edges from the graph
    Specified by:
      `removeEdges` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `edges` - the edges to remove

  - ### getEndpoints

    public edu.uci.ics.jung.graph.util.Pair<V> getEndpoints(E edge)

  - ### getOpposite

    public V getOpposite(V vertex, E edge)

  - ### removeEdge

    public boolean removeEdge(E edge)
    Description copied from interface: `GDirectedGraph`
    Removes an edge
    Specified by:
      `removeEdge` in interface `GDirectedGraph<V,E extends GEdge<V>>`
    Parameters:
      `edge` - the edge
    Returns:
      true if the graph contained the given edge

  - ### isNeighbor

    public boolean isNeighbor(V v1, V v2)

  - ### isIncident

    public boolean isIncident(V vertex, E edge)

  - ### degree

    public int degree(V vertex)

  - ### getNeighborCount

    public int getNeighborCount(V vertex)

  - ### getIncidentCount

    public int getIncidentCount(E edge)

  - ### getEdgeType

    public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(E edge)

  - ### getDefaultEdgeType

    public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()

  - ### getEdges

    public Collection<E> getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type)

  - ### getEdgeCount

    public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)