|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.mib.asn1.node.Node
This abstract class is the interface for all the nodes in the parse tree.
Field Summary | |
int |
kind
The kind of token. |
Constructor Summary | |
Node()
|
Method Summary | |
void |
apply(Switch sw)
Calls the relevant caseX method in the given switch. |
Node |
childAfter(Node child)
Returns the child coming after the given child. |
Node |
childAt(int index)
Returns a child with the given index. |
Node |
childOfType(int type)
Returns the first child of the given type. |
int |
children()
Returns the number of children to the current node. |
int |
childrenOfType(int type)
Returns the number of children of a given type to the current node. |
int |
firstColumn()
Finds the first column for the node. |
int |
firstLine()
Finds the first line for the node. |
Node |
getParent()
Returns the parent node of this node. |
boolean |
isAncestor(int type)
Checks if this node has an ancestor of the given type. |
boolean |
isParent(int type)
Checks if this node has a parent of the given type. |
boolean |
isType(int type)
Checks if this node is of the given type. |
int |
lastColumn()
Finds the last column for the node. |
int |
lastLine()
Finds the last line for the node. |
void |
setParent(Node parent)
Sets the given node as parent node to this node. |
static java.lang.String |
toName(int nodeType)
Returns the node name from the node type constant. |
static java.lang.String |
toName(Node node)
Returns the node name from the node object. |
java.lang.String |
toString()
Returns a string representation of this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int kind
Constructor Detail |
public Node()
Method Detail |
public static java.lang.String toName(int nodeType)
nodeType
- a node type constant value
public static java.lang.String toName(Node node)
node
- a node object
public void apply(Switch sw)
apply
in interface Switchable
sw
- a switch objectpublic Node childAfter(Node child)
child
- a child node
public Node childAt(int index)
index
- a child index, from 0 to children() - 1
public Node childOfType(int type)
type
- a node type constant value
public int children()
public int childrenOfType(int type)
type
- the type number
public Node getParent()
public boolean isAncestor(int type)
type
- a node type constant value
public boolean isParent(int type)
type
- a node type constant value
public boolean isType(int type)
type
- a node type constant value
public void setParent(Node parent)
parent
- the node parentpublic int firstLine()
public int firstColumn()
public int lastLine()
public int lastColumn()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |