|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.exist.xquery.value.AbstractSequence
org.exist.dom.AbstractNodeSet
org.exist.dom.VirtualNodeSet
This node set is called virtual because it is just a placeholder for the set of relevant nodes. For XPath expressions like //* or //node(), it would be totally unefficient to actually retrieve all descendant nodes. In many cases, the expression can be resolved at a later point in time without retrieving the whole node set. VirtualNodeSet basically provides method getFirstParent to retrieve the first matching descendant of its context according to the primary type axis. Class LocationStep will always return an instance of VirtualNodeSet if it finds something like descendant::* etc..
| 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 | |
VirtualNodeSet(int axis,
NodeTest test,
int contextId,
NodeSet context)
|
|
| Method Summary | |
void |
add(DocumentImpl doc,
long nodeId)
|
void |
add(org.w3c.dom.Node node)
|
void |
add(NodeProxy proxy)
Add a new proxy object to the node set. |
void |
addAll(org.w3c.dom.NodeList other)
|
void |
addAll(NodeSet other)
Add all nodes from the given node set. |
void |
clearContext()
|
boolean |
contains(NodeProxy p)
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 proxy)
Get a node from this node set matching the document and node id of the given NodeProxy. |
DocumentSet |
getDocumentSet()
Returns the set of documents from which the node items in this sequence have been selected. |
int |
getLength()
Return the number of nodes contained in this node set. |
boolean |
hasIndex()
|
boolean |
hasOne()
Returns whether the sequence has just one item or not. |
NodeSet |
intersection(NodeSet other)
Return a new node set, which represents the intersection of the current node set with the given node set. |
boolean |
isEmpty()
Returns whether the sequence is empty or not. |
org.w3c.dom.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. |
NodeProxy |
parentWithChild(DocumentImpl doc,
NodeId nodeId,
boolean directParent,
boolean includeSelf)
Check if the node identified by its node id has an ancestor contained in this node set and return the ancestor found. |
NodeProxy |
parentWithChild(NodeProxy proxy,
boolean directParent,
boolean includeSelf,
int level)
Check if the given node has an ancestor contained in this node set and return the ancestor found. |
void |
realize()
|
void |
remove(NodeProxy node)
|
void |
set(int position,
DocumentImpl doc,
long nodeId)
|
void |
setContextId(int contextId)
|
void |
setInPredicate(boolean predicate)
|
void |
setSelfIsContext()
|
java.lang.String |
toString()
|
NodeSet |
union(NodeSet other)
Return a new node set which represents the union of the current node set and the given node set. |
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
| 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 |
public VirtualNodeSet(int axis,
NodeTest test,
int contextId,
NodeSet context)
| Method Detail |
public boolean contains(NodeProxy p)
AbstractNodeSet
contains in interface NodeSetcontains in class AbstractNodeSetp - public void setInPredicate(boolean predicate)
public DocumentSet getDocumentSet()
Sequence
getDocumentSet in interface NodeSetgetDocumentSet in class AbstractNodeSet
public NodeProxy parentWithChild(NodeProxy proxy,
boolean directParent,
boolean includeSelf,
int level)
AbstractNodeSet
parentWithChild in interface NodeSetparentWithChild in class AbstractNodeSet
public NodeProxy parentWithChild(DocumentImpl doc,
NodeId nodeId,
boolean directParent,
boolean includeSelf)
NodeSet
parentWithChild in interface NodeSetparentWithChild in class AbstractNodeSetpublic final void realize()
public void setSelfIsContext()
public void setContextId(int contextId)
public boolean hasIndex()
public boolean isEmpty()
Sequence
isEmpty in interface SequenceisEmpty in class AbstractSequencepublic boolean hasOne()
Sequence
hasOne in interface SequencehasOne in class AbstractSequence
public void add(DocumentImpl doc,
long nodeId)
public void add(org.w3c.dom.Node node)
public void add(NodeProxy proxy)
AbstractNodeSet
add in interface NodeSetadd in class AbstractNodeSetproxy - public void addAll(org.w3c.dom.NodeList other)
public void addAll(NodeSet other)
AbstractNodeSet
addAll in interface NodeSetaddAll in class AbstractNodeSetother -
public void set(int position,
DocumentImpl doc,
long nodeId)
public void remove(NodeProxy node)
public int getLength()
AbstractNodeSet
getLength in interface SequencegetLength in class AbstractNodeSetpublic org.w3c.dom.Node item(int pos)
item in interface org.w3c.dom.NodeListitem in class AbstractNodeSetpublic NodeProxy get(int pos)
AbstractNodeSet
get in interface NodeSetget in class AbstractNodeSetpos - public Item itemAt(int pos)
Sequence
itemAt in interface SequenceitemAt in class AbstractSequence
public NodeProxy get(DocumentImpl doc,
NodeId nodeId)
public NodeProxy get(NodeProxy proxy)
AbstractNodeSet
get in interface NodeSetget in class AbstractNodeSetproxy - public NodeSetIterator iterator()
AbstractNodeSet
iterator in interface NodeSetiterator in class AbstractNodeSet
public SequenceIterator iterate()
throws XPathException
Sequence
iterate in interface Sequenceiterate in class AbstractNodeSetXPathExceptionpublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator in interface SequenceunorderedIterator in class AbstractNodeSetpublic NodeSet intersection(NodeSet other)
AbstractNodeSet
intersection in interface NodeSetintersection in class AbstractNodeSetother - public NodeSet union(NodeSet other)
AbstractNodeSet
union in interface NodeSetunion in class AbstractNodeSetother - public void clearContext()
public java.lang.String toString()
toString in class AbstractNodeSet
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||