public class TreeQuery
extends java.lang.Object
Constructor and Description |
---|
TreeQuery() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Optional<T> |
lowestCommonAncestor(TreeDef.Parented<T> treeDef,
T nodeA,
T nodeB)
Returns the common parent of the two given elements.
|
static <T> java.util.Optional<T> |
lowestCommonAncestorN(TreeDef.Parented<T> treeDef,
T... nodes)
Returns the common parent of N elements.
|
static <T> java.util.List<T> |
toParent(TreeDef.Parented<T> treeDef,
T node,
T parent)
Returns a mutable list whose first element is the child, and last element is the root.
|
static <T> java.util.List<T> |
toRoot(TreeDef.Parented<T> treeDef,
T node)
Returns a mutable list whose first element is the child, and last element is the root.
|
public static <T> java.util.List<T> toRoot(TreeDef.Parented<T> treeDef, T node)
public static <T> java.util.List<T> toParent(TreeDef.Parented<T> treeDef, T node, T parent)
public static <T> java.util.Optional<T> lowestCommonAncestor(TreeDef.Parented<T> treeDef, T nodeA, T nodeB)
@SafeVarargs public static <T> java.util.Optional<T> lowestCommonAncestorN(TreeDef.Parented<T> treeDef, T... nodes)