public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
findNode(Stack<Node> stack,
Class<T> target)
Find the first node of a type from ancestor stack, starting from parents.
|
static Node |
getNthAncestor(Stack<Node> st,
int n)
Gets the nth ancestor (the parent being the 1st ancestor) in the traversal
path.
|
public static Node getNthAncestor(Stack<Node> st, int n)
st - The stack that encodes the traversal path.n - The value of n (n=0 is the currently visited node).Copyright © 2017 The Apache Software Foundation. All rights reserved.