Modifier and Type | Field and Description |
---|---|
static short |
COMMENT_TYPE
Node type constant denoting a Comment node.
|
static short |
DOCUMENT_TYPE
Node type constant denoting a Document node.
|
static short |
ELEMENT_TYPE
Node type constant denoting an Element node.
|
static short |
TEXT_TYPE
Node type constant denoting a Text node.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes this node and all its children/descendants from the dom tree, and sets this element's parent attribute to null;
does nothing if this element has no parent.
|
Element |
findNearestCommonAncestor(Node node) |
Element |
getParent()
Returns the parent Element.
|
short |
getType()
Returns the node type constant of this node.
|
boolean |
isAfter(Node node)
Whether this node occurs after the specified node.
|
boolean |
isBefore(Node node)
Whether this node occurs after the specified node.
|
boolean |
isBetween(Node startNode,
Node endNode)
Whether or not this node occurs in the range between the specified startNode and endNode, inclusive of the start and end nodes.
|
boolean |
isBetween(Node startNode,
Node endNode,
boolean inclusive)
Whether or not this node occurs in the range between the specified startNode and endNode, inclusivity as specified.
|
Node |
nextNode()
Returns the next node, or null if none exists.
|
Node |
nextNodeSibling()
Return the next sibling Node (ie, the next Node that has the same parent) or null if none exists.
|
Node |
nextNonDescendantNode()
Return the next non-descendant Node (which may or may not be a sibling node) or returns null if none exists.
|
Node |
previousNode()
Returns the previous node, or null if none exists.
|
Node |
previousNodeSibling()
Return the previous sibling Node (ie, the prevous Node that has the same parent) or null if none exists.
|
static String |
typeToString(short type)
Returns a string representation of a Node type constant.
|
public static final short ELEMENT_TYPE
public static final short TEXT_TYPE
public static final short COMMENT_TYPE
public static final short DOCUMENT_TYPE
public Node previousNode()
public Node nextNode()
public Node nextNonDescendantNode()
public Node nextNodeSibling()
public Node previousNodeSibling()
public boolean isBetween(Node startNode, Node endNode)
startNode
- lower bound node, or null for no lower bound.endNode
- upper bound node, or null for no upper bound.public boolean isBetween(Node startNode, Node endNode, boolean inclusive)
startNode
- lower bound node, or null for no lower bound.endNode
- upper bound node, or null for no upper bound.inclusive
- whether the range is inclusive of the startNode and endNode.public boolean isBefore(Node node)
public boolean isAfter(Node node)
public short getType()
public Element getParent()
public static String typeToString(short type)
public void delete()