Enum Graphs.TransitiveClosureSelfLoopStrategy

java.lang.Object
java.lang.Enum<Graphs.TransitiveClosureSelfLoopStrategy>
com.google.common.graph.Graphs.TransitiveClosureSelfLoopStrategy
All Implemented Interfaces:
Serializable, Comparable<Graphs.TransitiveClosureSelfLoopStrategy>, Constable
Enclosing class:
Graphs

public static enum Graphs.TransitiveClosureSelfLoopStrategy extends Enum<Graphs.TransitiveClosureSelfLoopStrategy>
A strategy for adding self-loops to the transitive closure graph. All strategies preserve self-loops that are present in the original graph.

The strategies differ based on how they define "cycle incident to a node".

Since:
NEXT
Author:
James Sexton, Joshua O'Madadhain
  • Enum Constant Details

    • ADD_SELF_LOOPS_ALWAYS

      public static final Graphs.TransitiveClosureSelfLoopStrategy ADD_SELF_LOOPS_ALWAYS
      Add a self-loop to each node in the original graph; this is based on a definition of "cycle incident to a node" that includes zero-length cycles. This matches the behavior of the now-deprecated Graphs.transitiveClosure(Graph) method.
    • ADD_SELF_LOOPS_FOR_CYCLES

      public static final Graphs.TransitiveClosureSelfLoopStrategy ADD_SELF_LOOPS_FOR_CYCLES
      Add a self-loop to each node that is incident to a cycle of length one or greater in the original graph.
  • Method Details

    • values

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

      public static Graphs.TransitiveClosureSelfLoopStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null