Package com.google.common.graph
Enum Graphs.TransitiveClosureSelfLoopStrategy
- java.lang.Object
-
- java.lang.Enum<Graphs.TransitiveClosureSelfLoopStrategy>
-
- com.google.common.graph.Graphs.TransitiveClosureSelfLoopStrategy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Graphs.TransitiveClosureSelfLoopStrategy>
- Enclosing class:
- Graphs
public static enum Graphs.TransitiveClosureSelfLoopStrategy extends java.lang.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:
- 33.6.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD_SELF_LOOPS_ALWAYSAdd 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.ADD_SELF_LOOPS_FOR_CYCLESAdd a self-loop to each node that is incident to a cycle of length one or greater in the original graph.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Graphs.TransitiveClosureSelfLoopStrategyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Graphs.TransitiveClosureSelfLoopStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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-deprecatedGraphs.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 Detail
-
values
public static Graphs.TransitiveClosureSelfLoopStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Graphs.TransitiveClosureSelfLoopStrategy c : Graphs.TransitiveClosureSelfLoopStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Graphs.TransitiveClosureSelfLoopStrategy valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-