Qizx/Open v0.4

net.xfra.qizxopen.dm
Interface FONIDocument

All Known Implementing Classes:
IDocument

public interface FONIDocument

Fully-Ordered Node Identification Document. A representation of XML Documents where nodes are accessed by integer handles whose values are guaranteed to be in document order (i.e. node N1 before node N2 <=> handle(N1) < handle(N2) )

Such a representation is suitable for documents that are built in one operation such as parsing and never modified.

The interface is very close to the XPath/XQuery/XSLT Data Model.

The handle value 0 is reserved and represents a null or absent node.


Nested Class Summary
static interface FONIDocument.NodeIterator
           
 
Method Summary
 FONIDocument.NodeIterator attrIterator(int nodeId)
          Returns an Attribute iterator for a node.
 FONIDocument.NodeIterator childrenIterator(int nodeId)
           
 int estimateMemorySize()
          Cache management.
 int getAttrCount(int nodeId)
          Returns the number of attributes of an element (not guaranteed to be efficient).
 int getAttribute(int nodeId, int nameId)
          Gets an attribute node by name.
 java.lang.String getBaseURI()
          Returns the URI of the document.
 char[] getCharValue(int nodeId, int reserve)
          Specially meant for indexing: gets the string value of a text node.
 int getDefinedNSCount(int nodeId)
          Returns the number of NS defined on this node.
 int getDocId()
           
 QName getElementName(int nameId)
          Gets the QName of an element node by the internal id.
 int getElementNameCount()
          Gets the total number of element names.
 int getFirstChild(int nodeId)
           
 long getIntegerValue(int nodeId)
          Gets an integer value from an atome of type ATOM_INT.
 int getKind(int nodeId)
          Returns one of the kinds DOCUMENT, ELEMENT, TEXT, PROCESSING_INSTRUCTION, COMMENT, ATTRIBUTE, NAMESPACE, ATOM_XX.
 QName getName(int nodeId)
          Gets the name of a Node.
 int getNameId(int nodeId)
          Gets the name-id of a real Node.
 int getNextSibling(int nodeId)
           
 int getNodeAfter(int nodeId)
          Gets the node that is next in document order but not contained.
 int getNodeNext(int nodeId)
          Gets the node that is next in document order.
 int getNodeSpan(int nodeId)
           
 QName getOtherName(int nameId)
          Gets the QName of a non-element node by the internal id.
 int getOtherNameCount()
          Gets the total number of non-element node names.
 int getParent(int nodeId)
           
 int getRootNode()
          Returns the handle of the document node.
 java.lang.String getStringValue(int nodeId)
          Gets the string value for any node but Attributes and Namespaces.
 java.lang.Object getValue(int nodeId)
          Gets an atomic value from a leaf node.
 int internElementName(QName name)
          Gets the internal id of an element name.
 int internOtherName(QName name)
          Gets the internal id of a non-element node name.
 FONIDocument.NodeIterator namespaceIterator(int nodeId, boolean inScope)
          Returns the namespace nodes of a node.
 char[] pnGetCharValue(int nodeId, int reserve)
          Specially meant for indexing: gets the string value of a "pseudo-node" (attribute or NS).
 QName pnGetName(int nodeId)
          Gets the name of a pseudo Node Attribute / Namespace.
 int pnGetNameId(int nodeId)
          Gets the name-id of a pseudo-node Attribute / Namespace.
 java.lang.String pnGetStringValue(int nodeId)
          Gets the string value for pseudo-nodes Attributes and Namespaces.
 void setDocId(int docId)
           
 

Method Detail

getRootNode

public int getRootNode()
Returns the handle of the document node.


getKind

public int getKind(int nodeId)
Returns one of the kinds DOCUMENT, ELEMENT, TEXT, PROCESSING_INSTRUCTION, COMMENT, ATTRIBUTE, NAMESPACE, ATOM_XX.


getName

public QName getName(int nodeId)
Gets the name of a Node.


pnGetName

public QName pnGetName(int nodeId)
Gets the name of a pseudo Node Attribute / Namespace.


getNameId

public int getNameId(int nodeId)
Gets the name-id of a real Node. All names are represented by an index in a name table.


pnGetNameId

public int pnGetNameId(int nodeId)
Gets the name-id of a pseudo-node Attribute / Namespace.


getParent

public int getParent(int nodeId)

getNextSibling

public int getNextSibling(int nodeId)

getNodeSpan

public int getNodeSpan(int nodeId)

getNodeNext

public int getNodeNext(int nodeId)
Gets the node that is next in document order. (first child if non-atomic, otherwise returns getNodeAfter()).


getNodeAfter

public int getNodeAfter(int nodeId)
Gets the node that is next in document order but not contained. It is the following sibling if any, else the parent's following sibling, recursively.


getFirstChild

public int getFirstChild(int nodeId)

childrenIterator

public FONIDocument.NodeIterator childrenIterator(int nodeId)

attrIterator

public FONIDocument.NodeIterator attrIterator(int nodeId)
Returns an Attribute iterator for a node.


getAttrCount

public int getAttrCount(int nodeId)
Returns the number of attributes of an element (not guaranteed to be efficient).


getAttribute

public int getAttribute(int nodeId,
                        int nameId)
Gets an attribute node by name.


getStringValue

public java.lang.String getStringValue(int nodeId)
Gets the string value for any node but Attributes and Namespaces.


pnGetStringValue

public java.lang.String pnGetStringValue(int nodeId)
Gets the string value for pseudo-nodes Attributes and Namespaces.


getCharValue

public char[] getCharValue(int nodeId,
                           int reserve)
Specially meant for indexing: gets the string value of a text node. Returns the value into a char array, reserving chars (at head if reserve > 0).


pnGetCharValue

public char[] pnGetCharValue(int nodeId,
                             int reserve)
Specially meant for indexing: gets the string value of a "pseudo-node" (attribute or NS). Returns the value into a char array, possibly reserving leading chars.


getValue

public java.lang.Object getValue(int nodeId)
Gets an atomic value from a leaf node.


getIntegerValue

public long getIntegerValue(int nodeId)
Gets an integer value from an atome of type ATOM_INT.


getDefinedNSCount

public int getDefinedNSCount(int nodeId)
Returns the number of NS defined on this node.


namespaceIterator

public FONIDocument.NodeIterator namespaceIterator(int nodeId,
                                                   boolean inScope)
Returns the namespace nodes of a node.


getElementNameCount

public int getElementNameCount()
Gets the total number of element names.


getElementName

public QName getElementName(int nameId)
Gets the QName of an element node by the internal id.


internElementName

public int internElementName(QName name)
Gets the internal id of an element name.


getOtherNameCount

public int getOtherNameCount()
Gets the total number of non-element node names.


getOtherName

public QName getOtherName(int nameId)
Gets the QName of a non-element node by the internal id.


internOtherName

public int internOtherName(QName name)
Gets the internal id of a non-element node name.


getBaseURI

public java.lang.String getBaseURI()
Returns the URI of the document.


estimateMemorySize

public int estimateMemorySize()
Cache management.


getDocId

public int getDocId()

setDocId

public void setDocId(int docId)

 Copyright Xavier FRANC 2003-2004