org.incava.java
Class SimpleNodeUtil
public
class
SimpleNodeUtil
extends Object
Miscellaneous routines for the SimpleNode.
Method Summary |
static void | dump(SimpleNode node, String prefix) |
static void | dump(SimpleNode node, String prefix, boolean showWhitespace) |
static SimpleNode | findChild(SimpleNode parent, Class childType) |
static SimpleNode | findChild(SimpleNode parent, Class childType, int index) |
static SimpleNode[] | findChildren(SimpleNode parent, Class childType) |
static SimpleNode[] | findChildren(SimpleNode parent)
Returns all children of the node. |
static Token | findToken(SimpleNode node, int tokenType) |
static List | getChildren(SimpleNode node)
Returns a list of children, both nodes and tokens. |
static List | getChildren(SimpleNode node, boolean getNodes, boolean getTokens)
Returns a list of children, optionally nodes and tokens. |
static List | getChildrenSerially(SimpleNode node)
Returns a list of child tokens, non-hierarchically. |
static List | getChildrenSerially(SimpleNode node, List list)
Returns a list of child tokens, non-hierarchically. |
static Token | getLeadingToken(SimpleNode node, int tokenType)
Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes). |
static List | getLeadingTokens(SimpleNode node)
Returns the tokens preceding the first child of the node. |
static int | getLevel(SimpleNode node)
Returns a numeric "level" for the node. |
protected static String | getLocation(Token t1, Token t2) |
static SimpleNode | getParent(SimpleNode node)
Returns the parent node. |
static List | getTokens(SimpleNode node)
Returns the tokens for a node. |
static boolean | hasChildren(SimpleNode node)
Returns whether the node has any children. |
static boolean | hasLeadingToken(SimpleNode node, int tokenType)
Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes). |
static void | print(SimpleNode node) |
static void | print(SimpleNode node, String prefix) |
static String | toString(SimpleNode node)
Returns the token images for the node. |
public static void dump(SimpleNode node, String prefix)
public static void dump(SimpleNode node, String prefix, boolean showWhitespace)
public static SimpleNode findChild(SimpleNode parent, Class childType)
public static SimpleNode findChild(SimpleNode parent, Class childType, int index)
public static SimpleNode[] findChildren(SimpleNode parent, Class childType)
public static SimpleNode[] findChildren(SimpleNode parent)
Returns all children of the node.
public static Token findToken(SimpleNode node, int tokenType)
public static List getChildren(SimpleNode node)
Returns a list of children, both nodes and tokens.
public static List getChildren(SimpleNode node, boolean getNodes, boolean getTokens)
Returns a list of children, optionally nodes and tokens.
public static List getChildrenSerially(SimpleNode node)
Returns a list of child tokens, non-hierarchically.
public static List getChildrenSerially(SimpleNode node, List list)
Returns a list of child tokens, non-hierarchically.
public static Token getLeadingToken(SimpleNode node, int tokenType)
Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes).
public static List getLeadingTokens(SimpleNode node)
Returns the tokens preceding the first child of the node.
public static int getLevel(SimpleNode node)
Returns a numeric "level" for the node. Zero is public or abstract, one
is protected, two is package, and three is private.
protected static String getLocation(Token t1, Token t2)
public static SimpleNode getParent(SimpleNode node)
Returns the parent node.
public static List getTokens(SimpleNode node)
Returns the tokens for a node.
public static boolean hasChildren(SimpleNode node)
Returns whether the node has any children.
public static boolean hasLeadingToken(SimpleNode node, int tokenType)
Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes).
public static void print(SimpleNode node)
public static void print(SimpleNode node, String prefix)
public static String toString(SimpleNode node)
Returns the token images for the node.