Package me.lucko.luckperms.common.graph
Enum Class TraversalAlgorithm
- All Implemented Interfaces:
Serializable,Comparable<TraversalAlgorithm>,java.lang.constant.Constable
A set of traversal algorithm implementations for
Graphs.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTraverses in breadth-first order.Traverses in depth-first post-order.Traverses in depth-first pre-order. -
Method Summary
Modifier and TypeMethodDescriptionabstract <N> Iterable<N> Returns an unmodifiableIterableover the nodes reachable fromstartNode, in the order defined by thealgorithm.static TraversalAlgorithmReturns the enum constant of this class with the specified name.static TraversalAlgorithm[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BREADTH_FIRST
Traverses in breadth-first order.That is, all the nodes of depth 0 are returned, then depth 1, then 2, and so on.
See Wikipedia for more info.
-
DEPTH_FIRST_PRE_ORDER
Traverses in depth-first pre-order."Pre-order" implies that nodes appear in the order in which they are first visited.
See Wikipedia for more info.
-
DEPTH_FIRST_POST_ORDER
Traverses in depth-first post-order."Post-order" implies that nodes appear in the order in which they are visited for the last time.
See Wikipedia for more info.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
traverse
Returns an unmodifiableIterableover the nodes reachable fromstartNode, in the order defined by thealgorithm.- Type Parameters:
N- the node type- Parameters:
graph- the graphstartNode- the start node- Returns:
- the traversal
-