|
|||||||
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
public class 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(DBBroker broker,
int axis,
NodeTest test,
int contextId,
NodeSet context)
Creates a new VirtualNodeSet instance. |
Method Summary | |
---|---|
void |
add(DocumentImpl doc,
long nodeId)
The method add |
void |
add(Node node)
The method add |
void |
add(NodeProxy proxy)
The method add |
void |
addAll(NodeList other)
The method addAll |
void |
addAll(NodeSet other)
The method addAll |
void |
clearContext()
The method clearContext |
boolean |
contains(NodeProxy p)
The method contains |
NodeSet |
filterDocuments(NodeSet otherSet)
The method filterDocuments |
NodeProxy |
get(DocumentImpl doc,
NodeId nodeId)
The method get |
NodeProxy |
get(int pos)
The method get |
NodeProxy |
get(NodeProxy proxy)
The method get |
Iterator |
getCollectionIterator()
The method getCollectionIterator |
DocumentSet |
getDocumentSet()
Returns the set of documents from which the node items in this sequence have been selected. |
int |
getItemCount()
The method getItemCount |
int |
getLength()
The method getLength |
boolean |
hasIndex()
|
boolean |
hasMany()
The method hasMany |
boolean |
hasOne()
The method hasOne |
NodeSet |
intersection(NodeSet other)
The method intersection |
boolean |
isEmpty()
The method isEmpty |
Node |
item(int pos)
The method item |
Item |
itemAt(int pos)
The method itemAt |
SequenceIterator |
iterate()
Returns an iterator over all items in the sequence. |
NodeSetIterator |
iterator()
The method iterator |
NodeProxy |
parentWithChild(DocumentImpl doc,
NodeId nodeId,
boolean restrictToDirectParent,
boolean includeSelf)
The method parentWithChild |
NodeProxy |
parentWithChild(NodeProxy proxy,
boolean restrictToDirectParent,
boolean includeSelf,
int level)
The method parentWithChild |
boolean |
preferTreeTraversal()
The method preferTreeTraversal |
void |
realize()
The method realize |
void |
remove(NodeProxy node)
The method remove |
void |
set(int position,
DocumentImpl doc,
long nodeId)
The method set |
void |
setContextId(int contextId)
The method setContextId |
void |
setInPredicate(boolean predicate)
The method setInPredicate |
void |
setSelfIsContext()
The method setSelfIsContext |
String |
toString()
The method toString |
NodeSet |
union(NodeSet other)
The method union |
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, isCacheable, 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, isCacheable, setSelfAsContext, toJavaObject |
Constructor Detail |
---|
public VirtualNodeSet(DBBroker broker, int axis, NodeTest test, int contextId, NodeSet context)
VirtualNodeSet
instance.
axis
- an int
valuetest
- a NodeTest
valuecontextId
- an int
valuecontext
- a NodeSet
valueMethod Detail |
---|
public boolean contains(NodeProxy p)
contains
contains
in interface NodeSet
contains
in class AbstractNodeSet
p
- a NodeProxy
value
boolean
valuepublic void setInPredicate(boolean predicate)
setInPredicate
predicate
- a boolean
valuepublic DocumentSet getDocumentSet()
Sequence
getDocumentSet
in interface NodeSet
getDocumentSet
in interface Sequence
getDocumentSet
in class AbstractNodeSet
public Iterator getCollectionIterator()
getCollectionIterator
getCollectionIterator
in interface NodeSet
getCollectionIterator
in interface Sequence
getCollectionIterator
in class AbstractNodeSet
Iterator
valuepublic NodeProxy parentWithChild(NodeProxy proxy, boolean restrictToDirectParent, boolean includeSelf, int level)
parentWithChild
parentWithChild
in interface NodeSet
parentWithChild
in class AbstractNodeSet
proxy
- a NodeProxy
valuerestrictToDirectParent
- a boolean
valueincludeSelf
- a boolean
valuelevel
- an int
value
NodeProxy
valuepublic NodeProxy parentWithChild(DocumentImpl doc, NodeId nodeId, boolean restrictToDirectParent, boolean includeSelf)
parentWithChild
parentWithChild
in interface NodeSet
parentWithChild
in class AbstractNodeSet
doc
- a DocumentImpl
valuenodeId
- a NodeId
valuerestrictToDirectParent
- a boolean
valueincludeSelf
- a boolean
value
NodeProxy
valuepublic final void realize()
realize
public boolean preferTreeTraversal()
preferTreeTraversal
boolean
valuepublic void setSelfIsContext()
setSelfIsContext
public void setContextId(int contextId)
setContextId
contextId
- an int
valuepublic boolean hasIndex()
public boolean isEmpty()
isEmpty
isEmpty
in interface Sequence
isEmpty
in class AbstractSequence
boolean
valuepublic boolean hasOne()
hasOne
hasOne
in interface Sequence
hasOne
in class AbstractSequence
boolean
valuepublic boolean hasMany()
hasMany
hasMany
in interface Sequence
hasMany
in class AbstractSequence
boolean
valuepublic void add(DocumentImpl doc, long nodeId)
add
doc
- a DocumentImpl
valuenodeId
- a long
valuepublic void add(Node node)
add
node
- a Node
valuepublic void add(NodeProxy proxy)
add
add
in interface NodeSet
add
in class AbstractNodeSet
proxy
- a NodeProxy
valuepublic void addAll(NodeList other)
addAll
other
- a NodeList
valuepublic void addAll(NodeSet other)
addAll
addAll
in interface NodeSet
addAll
in class AbstractNodeSet
other
- a NodeSet
valuepublic void set(int position, DocumentImpl doc, long nodeId)
set
position
- an int
valuedoc
- a DocumentImpl
valuenodeId
- a long
valuepublic void remove(NodeProxy node)
remove
node
- a NodeProxy
valuepublic int getLength()
getLength
getLength
in interface NodeList
getLength
in class AbstractNodeSet
int
valuepublic int getItemCount()
getItemCount
getItemCount
in interface Sequence
getItemCount
in class AbstractSequence
int
valuepublic Node item(int pos)
item
item
in interface NodeList
item
in class AbstractNodeSet
pos
- an int
value
Node
valuepublic NodeProxy get(int pos)
get
get
in interface NodeSet
get
in class AbstractNodeSet
pos
- an int
value
NodeProxy
valuepublic Item itemAt(int pos)
itemAt
itemAt
in interface Sequence
itemAt
in class AbstractSequence
pos
- an int
value
Item
valuepublic NodeProxy get(DocumentImpl doc, NodeId nodeId)
get
doc
- a DocumentImpl
valuenodeId
- a NodeId
value
NodeProxy
valuepublic NodeProxy get(NodeProxy proxy)
get
get
in interface NodeSet
get
in class AbstractNodeSet
proxy
- a NodeProxy
value
NodeProxy
valuepublic NodeSetIterator iterator()
iterator
iterator
in interface NodeSet
iterator
in class AbstractNodeSet
NodeSetIterator
valuepublic SequenceIterator iterate() throws XPathException
Sequence
iterate
in interface Sequence
iterate
in class AbstractNodeSet
XPathException
- TODOpublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator
in interface Sequence
unorderedIterator
in class AbstractNodeSet
public NodeSet intersection(NodeSet other)
intersection
intersection
in interface NodeSet
intersection
in class AbstractNodeSet
other
- a NodeSet
value
NodeSet
valuepublic NodeSet union(NodeSet other)
union
union
in interface NodeSet
union
in class AbstractNodeSet
other
- a NodeSet
value
NodeSet
valuepublic NodeSet filterDocuments(NodeSet otherSet)
filterDocuments
filterDocuments
in interface NodeSet
filterDocuments
in class AbstractNodeSet
otherSet
- a NodeSet
value
NodeSet
valuepublic void clearContext()
clearContext
public String toString()
toString
toString
in class AbstractNodeSet
String
value
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |