|
|||||||
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.xquery.value.EmptySequence
public class EmptySequence
Field Summary |
---|
Fields inherited from interface org.exist.xquery.value.Sequence |
---|
EMPTY_SEQUENCE |
Constructor Summary | |
---|---|
EmptySequence()
|
Method Summary | |
---|---|
void |
add(Item item)
Add an item to the current sequence. |
AtomicValue |
convertTo(int requiredType)
Try to convert the sequence into an atomic value. |
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. |
boolean |
hasOne()
Returns whether the sequence has just one item or not. |
boolean |
isEmpty()
Returns whether the sequence is empty or not. |
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. |
void |
removeDuplicates()
Explicitely remove all duplicate nodes from this sequence. |
MemoryNodeSet |
toMemNodeSet()
Convert the sequence into an in-memory node set. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
String |
toString()
|
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
Methods inherited from class org.exist.xquery.value.AbstractSequence |
---|
addAll, clearContext, conversionPreference, effectiveBooleanValue, getCardinality, getCollectionIterator, getDocumentSet, getState, getStringValue, hasChanged, hasMany, isCacheable, isCached, isPersistentSet, nodeMoved, setIsCached, setSelfAsContext, toJavaObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EmptySequence()
Method Detail |
---|
public int getItemType()
Sequence
Type.NODE
for node sets, Type.ITEM
for other sequences with mixed items.
getItemType
in interface Sequence
getItemType
in class AbstractSequence
public SequenceIterator iterate() throws XPathException
Sequence
iterate
in interface Sequence
iterate
in class AbstractSequence
XPathException
- TODOpublic SequenceIterator unorderedIterator() throws XPathException
Sequence
unorderedIterator
in interface Sequence
unorderedIterator
in class AbstractSequence
XPathException
public int getItemCount()
Sequence
getItemCount
in interface Sequence
getItemCount
in class AbstractSequence
public Item itemAt(int pos)
Sequence
itemAt
in interface Sequence
itemAt
in class AbstractSequence
public boolean isEmpty()
Sequence
isEmpty
in interface Sequence
isEmpty
in class AbstractSequence
true
is the sequence is emptypublic boolean hasOne()
Sequence
hasOne
in interface Sequence
hasOne
in class AbstractSequence
true
is the sequence has just one itempublic void add(Item item) throws XPathException
Sequence
XPathException
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 Sequence
add
in class AbstractSequence
XPathException
public AtomicValue convertTo(int requiredType) throws XPathException
Sequence
Type
. An XPathException
is thrown if the conversion is impossible.
convertTo
in interface Sequence
convertTo
in class AbstractSequence
requiredType
- one of the type constants defined in class Type
XPathException
public NodeSet toNodeSet() throws XPathException
Sequence
XPathException
- if the sequence contains items which are not nodes.public MemoryNodeSet toMemNodeSet() throws XPathException
Sequence
Sequence.isPersistentSet()
to check
if the sequence is a persistent node set.
XPathException
- if the sequence contains items which are not nodes or is
a persistent node setpublic void removeDuplicates()
Sequence
public String toString()
toString
in class AbstractSequence
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |