public class Utils
extends java.lang.Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
findNode(java.util.Stack<Node> stack,
java.lang.Class<T> target)
Find the first node of a type from ancestor stack, starting from parents.
|
static Node |
getNthAncestor(java.util.Stack<Node> st,
int n)
Gets the nth ancestor (the parent being the 1st ancestor) in the traversal
path.
|
public static Node getNthAncestor(java.util.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).public static <T> T findNode(java.util.Stack<Node> stack, java.lang.Class<T> target)
Copyright © 2012 The Apache Software Foundation