Package fr.gouv.vitam.common.graph

# Class DirectedGraph

java.lang.Object
fr.gouv.vitam.common.graph.DirectedGraph

public class DirectedGraph extends Object
DirectedGraph

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DirectedGraph(com.fasterxml.jackson.databind.JsonNode jsonGraph)`
  Initializes a DirectedGraph from the specified JsonNode.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getId(Integer index)`
  Retrieve the id mapping the index
  `int`
  `getVertices()`
  Returns the number of vertices in this DirectedGraph.
  `int`
  `indegree(int vertices)`
  Returns the number of directed edges incident to vertex `vertices`.
  `DirectedGraph`
  `reverse()`
  Returns the reverse of the DirectedGraph.
  `String`
  `toString()`
  Returns a string representation of the graph.

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

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

- ## Constructor Details

  - ### DirectedGraph

    public DirectedGraph(com.fasterxml.jackson.databind.JsonNode jsonGraph)
    Initializes a DirectedGraph from the specified JsonNode.
    Parameters:
      `jsonGraph` -
    Throws:
      `IndexOutOfBoundsException` - if the endpoints of any edge are not in prescribed range
      `IllegalArgumentException` - if the number of vertices or edges is negative

- ## Method Details

  - ### getVertices

    public int getVertices()
    Returns the number of vertices in this DirectedGraph.
    Returns:
      the number of vertices in this DirectedGraph

  - ### indegree

    public int indegree(int vertices)
    Returns the number of directed edges incident to vertex `vertices`. This is known as the indegree of vertex `vertices`.
    Parameters:
      `vertices` - the vertex
    Returns:
      the indegree of vertex `vertices`
    Throws:
      `IndexOutOfBoundsException` - unless 0 <= v < vertices

  - ### reverse

    public DirectedGraph reverse()
    Returns the reverse of the DirectedGraph.
    Returns:
      the reverse of the DirectedGraph (child[parents] to parent[children])

  - ### toString

    public String toString()
    Returns a string representation of the graph.
    Overrides:
      `toString` in class `Object`
    Returns:
      the number of vertice, adjacency lists

  - ### getId

    public String getId(Integer index)
    Retrieve the id mapping the index
    Parameters:
      `index` - index
    Returns:
      id