org.exist.dom
Class StoredNode

java.lang.Object
  extended byorg.exist.dom.NodeImpl
      extended byorg.exist.dom.StoredNode
All Implemented Interfaces:
org.w3c.dom.Node, QNameable
Direct Known Subclasses:
CharacterDataImpl, DocumentTypeImpl, NamedNode, ProcessingInstructionImpl

public class StoredNode
extends NodeImpl

The base class for all persistent DOM nodes in the database.

Author:
Wolfgang Meier

Field Summary
static int NODE_IMPL_ROOT_NODE_GID
           
static int NODE_IMPL_UNKNOWN_GID
           
static long UNKNOWN_NODE_IMPL_ADDRESS
           
static short UNKNOWN_NODE_IMPL_NODE_TYPE
           
 
Fields inherited from class org.exist.dom.NodeImpl
LOG
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
StoredNode(long gid)
           
StoredNode(short nodeType)
           
StoredNode(short nodeType, long gid)
           
StoredNode(StoredNode other)
          Copy constructor: creates a copy of the other node.
 
Method Summary
 void clear()
          Reset this object to its initial state.
static StoredNode deserialize(byte[] data, int start, int len, DocumentImpl doc)
          Read a node from the specified byte array.
static StoredNode deserialize(byte[] data, int start, int len, DocumentImpl doc, boolean pooled)
          Read a node from the specified byte array.
 boolean equals(java.lang.Object obj)
           
 long firstChildID()
           
 DBBroker getBroker()
          Return the broker instance used to create this node.
 long getGID()
          Get the unique identifier assigned to this node.
 long getInternalAddress()
          Get the internal storage address of this node
protected  StoredNode getLastNode(java.util.Iterator iterator, StoredNode node)
           
protected  StoredNode getLastNode(StoredNode node)
           
 org.w3c.dom.Node getNextSibling()
           
 short getNodeType()
           
 org.w3c.dom.Document getOwnerDocument()
           
 long getParentGID()
          Get the unique node identifier of this node's parent node.
 org.w3c.dom.Node getParentNode()
           
 NodePath getPath()
           
 org.w3c.dom.Node getPreviousSibling()
           
 QName getQName()
           
 void release()
          Release all memory resources hold by this node.
 byte[] serialize()
           
 void setGID(long gid)
          Set the unique node identifier of this node.
 void setInternalAddress(long internalAddress)
          Set the internal storage address of this node.
 void setOwnerDocument(org.w3c.dom.Document ownerDocument)
          Set the owner document.
 java.lang.String toString()
           
 java.lang.String toString(boolean top)
           
 
Methods inherited from class org.exist.dom.NodeImpl
appendChild, appendChildren, cloneNode, compareDocumentPosition, getAttributes, getAttributesCount, getBaseURI, getChildCount, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeName, getNodeValue, getPrefix, getTextContent, getUserData, hasAttributes, hasChildNodes, insertAfter, insertAfter, insertBefore, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, removeChild, replaceChild, replaceChild, setAttributes, setChildCount, setNodeName, setNodeValue, setPrefix, setTextContent, setUserData, supports, updateChild, updateChild
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_IMPL_UNKNOWN_GID

public static final int NODE_IMPL_UNKNOWN_GID
See Also:
Constant Field Values

NODE_IMPL_ROOT_NODE_GID

public static final int NODE_IMPL_ROOT_NODE_GID
See Also:
Constant Field Values

UNKNOWN_NODE_IMPL_ADDRESS

public static final long UNKNOWN_NODE_IMPL_ADDRESS
See Also:
Constant Field Values

UNKNOWN_NODE_IMPL_NODE_TYPE

public static final short UNKNOWN_NODE_IMPL_NODE_TYPE
See Also:
Constant Field Values
Constructor Detail

StoredNode

public StoredNode(short nodeType)

StoredNode

public StoredNode(long gid)

StoredNode

public StoredNode(short nodeType,
                  long gid)

StoredNode

public StoredNode(StoredNode other)
Copy constructor: creates a copy of the other node.

Parameters:
other -
Method Detail

clear

public void clear()
Reset this object to its initial state. Required by the parser to be able to reuse node objects.


serialize

public byte[] serialize()

deserialize

public static StoredNode deserialize(byte[] data,
                                     int start,
                                     int len,
                                     DocumentImpl doc)
Read a node from the specified byte array. This checks the node type and calls the #deserialize(byte[], int, int) method of the corresponding node class.

Parameters:
data -
start -
len -
doc -
Returns:

deserialize

public static StoredNode deserialize(byte[] data,
                                     int start,
                                     int len,
                                     DocumentImpl doc,
                                     boolean pooled)
Read a node from the specified byte array. This checks the node type and calls the #deserialize(byte[], int, int) method of the corresponding node class. The node will be allocated in the pool and should be released once it is no longer needed.

Parameters:
data -
start -
len -
doc -
Returns:

getQName

public QName getQName()

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

getBroker

public DBBroker getBroker()
Return the broker instance used to create this node.

Returns:

getGID

public long getGID()
Get the unique identifier assigned to this node.

Returns:

setGID

public void setGID(long gid)
Set the unique node identifier of this node.

Parameters:
gid - The new gID value

getInternalAddress

public long getInternalAddress()
Get the internal storage address of this node

Returns:
The internalAddress value

setInternalAddress

public void setInternalAddress(long internalAddress)
Set the internal storage address of this node.


getNodeType

public short getNodeType()
See Also:
Node.getNodeType()

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
See Also:
Node.getOwnerDocument()

setOwnerDocument

public void setOwnerDocument(org.w3c.dom.Document ownerDocument)
Set the owner document.


getParentGID

public long getParentGID()
Get the unique node identifier of this node's parent node.

Returns:
The parentGID value

firstChildID

public long firstChildID()

getParentNode

public org.w3c.dom.Node getParentNode()
See Also:
Node.getParentNode()

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()
See Also:
Node.getPreviousSibling()

getNextSibling

public org.w3c.dom.Node getNextSibling()
See Also:
Node.getNextSibling()

getLastNode

protected StoredNode getLastNode(StoredNode node)

getLastNode

protected StoredNode getLastNode(java.util.Iterator iterator,
                                 StoredNode node)

getPath

public NodePath getPath()

toString

public java.lang.String toString()

toString

public java.lang.String toString(boolean top)

release

public void release()
Release all memory resources hold by this node.



<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.