|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents the internal id of a node within eXist. Basically, all stored nodes in eXist need to have an id that implements this interface. The id will be assigned according to used numbering scheme. From a given id, we can determine the relationship of the node it represents to any other node in the same document.
Field Summary | |
static NodeId |
DOCUMENT_NODE
Static field representing the document node. |
static NodeId |
END_OF_DOCUMENT
|
static int |
IS_CHILD
|
static int |
IS_DESCENDANT
|
static int |
IS_SELF
|
Method Summary | |
boolean |
after(NodeId other,
boolean isFollowing)
Returns true if the node represented by this node id comes after the argument node in document order. |
boolean |
before(NodeId other,
boolean isPreceding)
Returns true if the node represented by this node id comes before the argument node in document order. |
int |
compareTo(NodeId other)
|
int |
computeRelation(NodeId ancestor)
Computes the relationship of this node to the given potential ancestor node. |
boolean |
equals(NodeId other)
|
NodeId |
getParentId()
Returns a new NodeId representing the parent of the current node. |
int |
getTreeLevel()
Returns the level within the document tree at which this node occurs. |
NodeId |
insertBefore()
|
NodeId |
insertNode(NodeId right)
|
boolean |
isChildOf(NodeId parent)
Is the current node a child node of the specified parent? |
boolean |
isDescendantOf(NodeId ancestor)
Is the current node id a descendant of the specified node? |
boolean |
isDescendantOrSelfOf(NodeId ancestor)
|
boolean |
isSiblingOf(NodeId sibling)
|
NodeId |
newChild()
Returns a new NodeId representing the first child node of this node. |
NodeId |
nextSibling()
Returns a new NodeId representing the next following sibling of this node. |
void |
serialize(byte[] data,
int offset)
Serializes the node id to an array of bytes. |
int |
size()
Returns the size (in bytes) of this node id. |
int |
units()
|
void |
write(VariableByteOutputStream os)
Write the node id to a VariableByteOutputStream . |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
public static final NodeId DOCUMENT_NODE
public static final NodeId END_OF_DOCUMENT
public static final int IS_CHILD
public static final int IS_DESCENDANT
public static final int IS_SELF
Method Detail |
public NodeId newChild()
public NodeId nextSibling()
public NodeId insertNode(NodeId right)
public NodeId insertBefore()
public NodeId getParentId()
DOCUMENT_NODE
will be returned.
For the document itself, the parent id will be null.
public boolean after(NodeId other, boolean isFollowing)
other
- isFollowing
- public boolean before(NodeId other, boolean isPreceding)
other
- isPreceding
- public boolean isDescendantOf(NodeId ancestor)
ancestor
- node id of the potential ancestor
public boolean isDescendantOrSelfOf(NodeId ancestor)
public boolean isChildOf(NodeId parent)
parent
- the parent nodepublic int computeRelation(NodeId ancestor)
IS_CHILD
, IS_DESCENDANT
or IS_SELF
. If the nodes are not in a ancestor-descendant relation,
the method returns -1.
ancestor
- the (potential) ancestor node to check against
public boolean isSiblingOf(NodeId sibling)
public int getTreeLevel()
public int compareTo(NodeId other)
public boolean equals(NodeId other)
public int size()
public int units()
public void serialize(byte[] data, int offset)
data
- the byte array to be filledoffset
- offset into the arraypublic void write(VariableByteOutputStream os) throws java.io.IOException
VariableByteOutputStream
.
os
-
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |