Enum Class EdgeType

java.lang.Object
java.lang.Enum<EdgeType>
com.kobayami.graphity.EdgeType
All Implemented Interfaces:
Serializable, Comparable<EdgeType>, Constable

public enum EdgeType extends Enum<EdgeType>
The type of an edge in a DFS (depth-first search), as EdgeTypes classifies the edges of a graph.

A depth-first search through all nodes reaches each node once, either by a tree edge or as the root of a new search tree; the tree edges form the DFS forest. Every other edge gets its type from where its target lies relative to its source in that forest, so each edge has exactly one type. Edges.of(EdgeTypes, EdgeType) collects the edges of one type.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    An edge to an ancestor of its source in the DFS forest, or to the source itself.
    An edge between two nodes of which neither is an ancestor of the other in the DFS forest: the search had finished the target before it reached the source.
    An edge to a descendant of its source in the DFS forest, other than a tree edge.
    An edge by which the search reaches its target for the first time: an edge of the forest.
  • Method Summary

    Modifier and Type
    Method
    Description
    static EdgeType
    Returns the enum constant of this class with the specified name.
    static EdgeType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TREE

      public static final EdgeType TREE
      An edge by which the search reaches its target for the first time: an edge of the forest.
    • BACK

      public static final EdgeType BACK
      An edge to an ancestor of its source in the DFS forest, or to the source itself. A graph has a cycle exactly when it has a back edge.
    • FORWARD

      public static final EdgeType FORWARD
      An edge to a descendant of its source in the DFS forest, other than a tree edge.
    • CROSS

      public static final EdgeType CROSS
      An edge between two nodes of which neither is an ancestor of the other in the DFS forest: the search had finished the target before it reached the source.
  • Method Details

    • values

      public static EdgeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EdgeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null