org.exist.dom
Class AVLTreeNodeSet

java.lang.Object
  extended by org.exist.xquery.value.AbstractSequence
      extended by org.exist.dom.AbstractNodeSet
          extended by org.exist.dom.AVLTreeNodeSet
All Implemented Interfaces:
NodeSet, Sequence, NodeList

public class AVLTreeNodeSet
extends AbstractNodeSet


Field Summary
 
Fields inherited from interface org.exist.dom.NodeSet
ANCESTOR, DESCENDANT, EMPTY_SET, FOLLOWING, PRECEDING
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Constructor Summary
AVLTreeNodeSet()
           
 
Method Summary
 void add(NodeProxy proxy)
          Add a new proxy object to the node set.
 void addAll(NodeSet other)
          Add all nodes from the given node set.
 boolean contains(NodeProxy proxy)
          Check if this node set contains a node matching the document and node-id of the given NodeProxy object.
 NodeProxy get(DocumentImpl doc, NodeId nodeId)
           
 NodeProxy get(int pos)
          Get the node at position pos within this node set.
 NodeProxy get(NodeProxy p)
          Get a node from this node set matching the document and node id of the given NodeProxy.
 int getItemCount()
          Returns the number of items contained in the sequence.
 int getLength()
          Return the number of nodes contained in this node set.
 org.exist.dom.AVLTreeNodeSet.Node getMaxNode()
           
 org.exist.dom.AVLTreeNodeSet.Node getMinNode()
           
 int getState()
           
 boolean hasChanged(int previousState)
           
 boolean hasOne()
          Returns whether the sequence has just one item or not.
 boolean isCacheable()
           
 boolean isEmpty()
          Returns whether the sequence is empty or not.
 Node item(int pos)
           
 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.
 NodeSetIterator iterator()
          Return an iterator on the nodes in this list.
 void removeNode(org.exist.dom.AVLTreeNodeSet.Node node)
           
 org.exist.dom.AVLTreeNodeSet.Node searchData(NodeProxy proxy)
           
 String toString()
           
 SequenceIterator unorderedIterator()
          Returns an iterator over all items in the sequence.
 
Methods inherited from class org.exist.dom.AbstractNodeSet
add, add, addAll, clearContext, deepIntersection, directSelectAttribute, except, filterDocuments, getAncestors, getCollectionIterator, getContextNodes, getDocumentSet, getIndexType, getItemType, getParents, getProcessInReverseOrder, getSizeHint, hasMixedContent, hasTextIndex, intersection, isCached, isPersistentSet, nodeMoved, parentWithChild, parentWithChild, removeDuplicates, selectAncestorDescendant, selectAncestors, selectFollowing, selectFollowingSiblings, selectParentChild, selectParentChild, selectPreceding, selectPrecedingSiblings, setIsCached, setProcessInReverseOrder, toNodeSet, union
 
Methods inherited from class org.exist.xquery.value.AbstractSequence
conversionPreference, convertTo, effectiveBooleanValue, getCardinality, getStringValue, hasMany, setSelfAsContext, toJavaObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.exist.xquery.value.Sequence
conversionPreference, convertTo, effectiveBooleanValue, getCardinality, getStringValue, hasMany, setSelfAsContext, toJavaObject
 

Constructor Detail

AVLTreeNodeSet

public AVLTreeNodeSet()
Method Detail

iterate

public SequenceIterator iterate()
                         throws XPathException
Description copied from interface: Sequence
Returns an iterator over all items in the sequence. The items are returned in document order where applicable.

Specified by:
iterate in interface Sequence
Specified by:
iterate in class AbstractNodeSet
Throws:
XPathException - TODO

unorderedIterator

public SequenceIterator unorderedIterator()
Description copied from interface: Sequence
Returns an iterator over all items in the sequence. The returned items may - but need not - to be in document order.

Specified by:
unorderedIterator in interface Sequence
Specified by:
unorderedIterator in class AbstractNodeSet

addAll

public void addAll(NodeSet other)
Description copied from class: AbstractNodeSet
Add all nodes from the given node set.

Specified by:
addAll in interface NodeSet
Specified by:
addAll in class AbstractNodeSet

getLength

public int getLength()
Description copied from class: AbstractNodeSet
Return the number of nodes contained in this node set.

Specified by:
getLength in interface NodeList
Specified by:
getLength in class AbstractNodeSet

getItemCount

public int getItemCount()
Description copied from interface: Sequence
Returns the number of items contained in the sequence. Call this method only when necessary, since it can be resource consuming.

Specified by:
getItemCount in interface Sequence
Specified by:
getItemCount in class AbstractSequence
Returns:
The number of items in the sequence

item

public Node item(int pos)
Specified by:
item in interface NodeList
Specified by:
item in class AbstractNodeSet

get

public NodeProxy get(int pos)
Description copied from class: AbstractNodeSet
Get the node at position pos within this node set.

Specified by:
get in interface NodeSet
Specified by:
get in class AbstractNodeSet

get

public final NodeProxy get(NodeProxy p)
Description copied from class: AbstractNodeSet
Get a node from this node set matching the document and node id of the given NodeProxy.

Specified by:
get in interface NodeSet
Specified by:
get in class AbstractNodeSet

isEmpty

public boolean isEmpty()
Description copied from interface: Sequence
Returns whether the sequence is empty or not.

Specified by:
isEmpty in interface Sequence
Specified by:
isEmpty in class AbstractSequence
Returns:
true is the sequence is empty

hasOne

public boolean hasOne()
Description copied from interface: Sequence
Returns whether the sequence has just one item or not.

Specified by:
hasOne in interface Sequence
Specified by:
hasOne in class AbstractSequence
Returns:
true is the sequence has just one item

itemAt

public Item itemAt(int pos)
Description copied from interface: Sequence
Returns the item located at the specified position within this sequence. Items are counted beginning at 0.

Specified by:
itemAt in interface Sequence
Specified by:
itemAt in class AbstractSequence

add

public final void add(NodeProxy proxy)
Description copied from class: AbstractNodeSet
Add a new proxy object to the node set. Please note: node set implementations may allow duplicates.

Specified by:
add in interface NodeSet
Specified by:
add in class AbstractNodeSet

getMinNode

public org.exist.dom.AVLTreeNodeSet.Node getMinNode()

getMaxNode

public org.exist.dom.AVLTreeNodeSet.Node getMaxNode()

searchData

public final org.exist.dom.AVLTreeNodeSet.Node searchData(NodeProxy proxy)

get

public final NodeProxy get(DocumentImpl doc,
                           NodeId nodeId)

contains

public final boolean contains(NodeProxy proxy)
Description copied from class: AbstractNodeSet
Check if this node set contains a node matching the document and node-id of the given NodeProxy object.

Specified by:
contains in interface NodeSet
Specified by:
contains in class AbstractNodeSet

removeNode

public void removeNode(org.exist.dom.AVLTreeNodeSet.Node node)

iterator

public NodeSetIterator iterator()
Description copied from class: AbstractNodeSet
Return an iterator on the nodes in this list. The iterator returns nodes according to the internal ordering of nodes (i.e. level first), not in document- order.

Specified by:
iterator in interface NodeSet
Specified by:
iterator in class AbstractNodeSet

hasChanged

public boolean hasChanged(int previousState)
Specified by:
hasChanged in interface NodeSet
Specified by:
hasChanged in interface Sequence
Overrides:
hasChanged in class AbstractNodeSet

getState

public int getState()
Specified by:
getState in interface NodeSet
Specified by:
getState in interface Sequence
Overrides:
getState in class AbstractNodeSet

isCacheable

public boolean isCacheable()
Specified by:
isCacheable in interface Sequence
Overrides:
isCacheable in class AbstractSequence

toString

public String toString()
Overrides:
toString in class AbstractNodeSet


Copyright (C) Wolfgang Meier. All rights reserved.