|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.memtree.NodeImpl
public class NodeImpl
| Field Summary | |
|---|---|
static short |
NAMESPACE_NODE
|
static short |
REFERENCE_NODE
|
| Fields inherited from interface org.exist.xquery.value.NodeValue |
|---|
IN_MEMORY_NODE, PERSISTENT_NODE |
| Fields inherited from interface org.exist.xquery.value.Sequence |
|---|
EMPTY_SEQUENCE |
| Constructor Summary | |
|---|---|
NodeImpl(DocumentImpl doc,
int nodeNumber)
|
|
| Method Summary | |
|---|---|
void |
add(Item item)
Add an item to the current sequence. |
void |
addAll(Sequence other)
Add all items of the other sequence to this item. |
void |
addContextNode(int contextId,
NodeValue node)
|
boolean |
after(NodeValue other,
boolean isFollowing)
Returns true if this node comes after another node in document order. |
Node |
appendChild(Node arg0)
|
AtomicValue |
atomize()
|
boolean |
before(NodeValue other,
boolean isPreceding)
Returns true if this node comes before another node in document order. |
void |
clearContext(int contextId)
For every item in the sequence, clear any context-dependant information that is stored during query processing. |
Node |
cloneNode(boolean arg0)
|
short |
compareDocumentPosition(Node other)
? @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node) |
int |
compareTo(Object other)
|
int |
conversionPreference(Class javaClass)
Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. |
AtomicValue |
convertTo(int requiredType)
Convert this item into an atomic value, whose type corresponds to the specified target type. |
void |
copyTo(DBBroker broker,
DocumentBuilderReceiver receiver)
|
void |
deepCopy()
|
boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence. |
boolean |
equals(NodeValue other)
Returns true if this node has the same identity as another node. |
boolean |
equals(Object obj)
|
void |
expand()
|
NamedNodeMap |
getAttributes()
|
String |
getBaseURI()
? @see org.w3c.dom.Node#getBaseURI() |
int |
getCardinality()
Returns the cardinality of this sequence. |
NodeList |
getChildNodes()
|
Iterator |
getCollectionIterator()
Return an iterator on all collections referenced by documents contained in this sequence.. |
DocumentImpl |
getDocument()
|
DocumentSet |
getDocumentSet()
Returns the set of documents from which the node items in this sequence have been selected. |
Object |
getFeature(String feature,
String version)
? @see org.w3c.dom.Node#getFeature(java.lang.String, java.lang.String) |
Node |
getFirstChild()
|
int |
getImplementationType()
Returns the implementation-type of this node, i.e. |
int |
getItemCount()
Returns the number of items contained in the sequence. |
int |
getItemType()
Return the primary type to which all items in this sequence belong. |
Node |
getLastChild()
|
int |
getLength()
|
String |
getLocalName()
|
String |
getNamespaceURI()
|
Node |
getNextSibling()
|
Node |
getNode()
Retrieve the actual node. |
String |
getNodeName()
|
int |
getNodeNumber()
|
short |
getNodeType()
|
String |
getNodeValue()
|
Document |
getOwnerDocument()
|
Node |
getParentNode()
|
String |
getPrefix()
|
Node |
getPreviousSibling()
|
QName |
getQName()
|
String |
getStringValue()
Return the string value of this item (see the definition of string value in XPath). |
String |
getTextContent()
? @see org.w3c.dom.Node#getTextContent() |
int |
getType()
Return the type of this item according to the type constants defined in class Type. |
Object |
getUserData(String key)
? @see org.w3c.dom.Node#getUserData(java.lang.String) |
boolean |
hasAttributes()
|
boolean |
hasChildNodes()
|
boolean |
hasMany()
Returns whether the sequence more than one item or not. |
boolean |
hasOne()
Returns whether the sequence has just one item or not. |
Node |
insertBefore(Node arg0,
Node arg1)
|
boolean |
isCached()
Returns true if the sequence is the result of a previous operation and has been cached. |
boolean |
isDefaultNamespace(String namespaceURI)
? @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) |
boolean |
isEmpty()
Returns whether the sequence is empty or not. |
boolean |
isEqualNode(Node arg)
? @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node) |
boolean |
isPersistentSet()
|
boolean |
isSameNode(Node other)
? @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node) |
boolean |
isSupported(String arg0,
String arg1)
|
Item |
itemAt(int pos)
Returns the item located at the specified position within this sequence. |
SequenceIterator |
iterate()
Returns an iterator over all items in the sequence. |
String |
lookupNamespaceURI(String prefix)
? @see org.w3c.dom.Node#lookupNamespaceURI(java.lang.String) |
String |
lookupPrefix(String namespaceURI)
? @see org.w3c.dom.Node#lookupPrefix(java.lang.String) |
void |
nodeMoved(NodeId oldNodeId,
StoredNode newNode)
Nodes may implement this method to be informed of storage address and node id changes after updates. |
void |
normalize()
|
Node |
removeChild(Node arg0)
|
void |
removeDuplicates()
Explicitely remove all duplicate nodes from this sequence. |
Node |
replaceChild(Node arg0,
Node arg1)
|
void |
setIsCached(boolean cached)
Indicates that the sequence is the result of a previous operation and has not been recomputed. |
void |
setNodeValue(String arg0)
|
void |
setPrefix(String arg0)
|
void |
setSelfAsContext(int contextId)
|
void |
setTextContent(String textContent)
? @see org.w3c.dom.Node#setTextContent(java.lang.String) |
Object |
setUserData(String key,
Object data,
UserDataHandler handler)
? @see org.w3c.dom.Node#setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler) |
void |
streamTo(Serializer serializer,
Receiver receiver)
|
Object |
toJavaObject(Class target)
Convert the value into an instance of the specified Java class. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
void |
toSAX(DBBroker broker,
ContentHandler handler)
|
Sequence |
toSequence()
Convert this item into a sequence, containing only the item. |
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short REFERENCE_NODE
public static final short NAMESPACE_NODE
| Constructor Detail |
|---|
public NodeImpl(DocumentImpl doc,
int nodeNumber)
| Method Detail |
|---|
public int getNodeNumber()
public int getImplementationType()
NodeValueNodeValue.IN_MEMORY_NODE or NodeValue.PERSISTENT_NODE.
getImplementationType in interface NodeValuepublic DocumentSet getDocumentSet()
Sequence
getDocumentSet in interface Sequencepublic Iterator getCollectionIterator()
Sequence
getCollectionIterator in interface Sequencepublic Node getNode()
NodeValue
getNode in interface NodeValuepublic String getNodeName()
getNodeName in interface Nodepublic QName getQName()
getQName in interface QNameable
public void expand()
throws DOMException
DOMException
public void deepCopy()
throws DOMException
DOMException
public String getNodeValue()
throws DOMException
getNodeValue in interface NodeDOMException
public void setNodeValue(String arg0)
throws DOMException
setNodeValue in interface NodeDOMExceptionpublic short getNodeType()
getNodeType in interface Nodepublic Node getParentNode()
getParentNode in interface Node
public void addContextNode(int contextId,
NodeValue node)
addContextNode in interface NodeValuepublic boolean equals(Object obj)
equals in class Object
public boolean equals(NodeValue other)
throws XPathException
NodeValue
equals in interface NodeValueXPathException
public boolean after(NodeValue other,
boolean isFollowing)
throws XPathException
NodeValue
after in interface NodeValueXPathException
public boolean before(NodeValue other,
boolean isPreceding)
throws XPathException
NodeValue
before in interface NodeValueXPathExceptionpublic int compareTo(Object other)
compareTo in interface Comparablepublic NodeList getChildNodes()
getChildNodes in interface Nodepublic Node getFirstChild()
getFirstChild in interface Nodepublic Node getLastChild()
getLastChild in interface Nodepublic Node getPreviousSibling()
getPreviousSibling in interface Nodepublic Node getNextSibling()
getNextSibling in interface Nodepublic NamedNodeMap getAttributes()
getAttributes in interface Nodepublic Document getOwnerDocument()
getOwnerDocument in interface NodeValuegetOwnerDocument in interface Nodepublic DocumentImpl getDocument()
public Node insertBefore(Node arg0,
Node arg1)
throws DOMException
insertBefore in interface NodeDOMException
public Node replaceChild(Node arg0,
Node arg1)
throws DOMException
replaceChild in interface NodeDOMException
public Node removeChild(Node arg0)
throws DOMException
removeChild in interface NodeDOMException
public Node appendChild(Node arg0)
throws DOMException
appendChild in interface NodeDOMExceptionpublic boolean hasChildNodes()
hasChildNodes in interface Nodepublic Node cloneNode(boolean arg0)
cloneNode in interface Nodepublic void normalize()
normalize in interface Node
public boolean isSupported(String arg0,
String arg1)
isSupported in interface Nodepublic String getNamespaceURI()
getNamespaceURI in interface Nodepublic String getPrefix()
getPrefix in interface Node
public void setPrefix(String arg0)
throws DOMException
setPrefix in interface NodeDOMExceptionpublic String getLocalName()
getLocalName in interface Nodepublic boolean hasAttributes()
hasAttributes in interface Nodepublic int getType()
ItemType.
getType in interface Itempublic String getStringValue()
Item
getStringValue in interface ItemgetStringValue in interface Sequencepublic Sequence toSequence()
Item
toSequence in interface Item
public AtomicValue convertTo(int requiredType)
throws XPathException
ItemType. An XPathException is thrown
if the conversion is impossible.
convertTo in interface ItemconvertTo in interface SequencerequiredType - one of the type constants defined in class Type
XPathException
public AtomicValue atomize()
throws XPathException
atomize in interface ItemXPathExceptionpublic boolean isEmpty()
Sequence
isEmpty in interface Sequencetrue is the sequence is emptypublic boolean hasOne()
Sequence
hasOne in interface Sequencetrue is the sequence has just one itempublic boolean hasMany()
Sequence
hasMany in interface Sequencetrue is the sequence more than one item
public void add(Item item)
throws XPathException
SequenceXPathException may be thrown
if the item's type is incompatible with this type of sequence (e.g. if the sequence
is a node set).
The sequence may or may not allow duplicate values.
add in interface SequenceXPathException
public void addAll(Sequence other)
throws XPathException
SequenceXPathException may
be thrown if the type of the items in the other sequence is incompatible with
the primary type of this sequence.
addAll in interface SequenceXPathExceptionpublic int getItemType()
SequenceType.NODE for node sets, Type.ITEM
for other sequences with mixed items.
getItemType in interface Sequence
public SequenceIterator iterate()
throws XPathException
Sequence
iterate in interface SequenceXPathException - TODOpublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator in interface Sequencepublic int getItemCount()
Sequence
getItemCount in interface Sequencepublic int getLength()
public int getCardinality()
SequenceCardinality.
getCardinality in interface SequenceCardinalitypublic Item itemAt(int pos)
Sequence
itemAt in interface Sequence
public boolean effectiveBooleanValue()
throws XPathException
Sequence
effectiveBooleanValue in interface SequenceXPathException
public NodeSet toNodeSet()
throws XPathException
Sequence
toNodeSet in interface SequenceXPathException - if the sequence contains items which are not nodes.
public void toSAX(DBBroker broker,
ContentHandler handler)
throws SAXException
toSAX in interface ItemSAXException
public void copyTo(DBBroker broker,
DocumentBuilderReceiver receiver)
throws SAXException
copyTo in interface ItemSAXException
public void streamTo(Serializer serializer,
Receiver receiver)
throws SAXException
SAXExceptionpublic int conversionPreference(Class javaClass)
Sequence
conversionPreference in interface ItemconversionPreference in interface Sequence
public Object toJavaObject(Class target)
throws XPathException
Sequence
toJavaObject in interface ItemtoJavaObject in interface SequenceXPathExceptionpublic void setSelfAsContext(int contextId)
setSelfAsContext in interface Sequencepublic boolean isCached()
Sequence
isCached in interface Sequencepublic void setIsCached(boolean cached)
Sequence
setIsCached in interface Sequencepublic void removeDuplicates()
Sequence
removeDuplicates in interface Sequencepublic String getBaseURI()
getBaseURI in interface Node
public short compareDocumentPosition(Node other)
throws DOMException
compareDocumentPosition in interface NodeDOMException
public String getTextContent()
throws DOMException
getTextContent in interface NodeDOMException
public void setTextContent(String textContent)
throws DOMException
setTextContent in interface NodeDOMExceptionpublic boolean isSameNode(Node other)
isSameNode in interface Nodepublic String lookupPrefix(String namespaceURI)
lookupPrefix in interface Nodepublic boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace in interface Nodepublic String lookupNamespaceURI(String prefix)
lookupNamespaceURI in interface Nodepublic boolean isEqualNode(Node arg)
isEqualNode in interface Node
public Object getFeature(String feature,
String version)
getFeature in interface Node
public Object setUserData(String key,
Object data,
UserDataHandler handler)
setUserData in interface Nodepublic Object getUserData(String key)
getUserData in interface Nodepublic boolean isPersistentSet()