|
|||||||
| 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.OrderedValueSequence
public class OrderedValueSequence
A sequence that sorts its entries in the order specified by the order specs of
an "order by" clause. Used by ForExpr.
Contrary to class PreorderedValueSequence,
all order expressions are evaluated once for each item in the sequence
while items are added.
| Field Summary |
|---|
| Fields inherited from interface org.exist.xquery.value.Sequence |
|---|
EMPTY_SEQUENCE |
| Constructor Summary | |
|---|---|
OrderedValueSequence(OrderSpec[] orderSpecs,
int size)
|
|
| 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. |
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. |
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. |
boolean |
isPersistentSet()
|
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. |
void |
sort()
|
MemoryNodeSet |
toMemNodeSet()
Convert the sequence into an in-memory node set. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
| Methods inherited from class org.exist.xquery.value.AbstractSequence |
|---|
clearContext, conversionPreference, convertTo, effectiveBooleanValue, getCardinality, getCollectionIterator, getDocumentSet, getStringValue, hasMany, isCached, nodeMoved, setIsCached, setSelfAsContext, toJavaObject, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedValueSequence(OrderSpec[] orderSpecs,
int size)
| Method Detail |
|---|
public SequenceIterator iterate()
throws XPathException
Sequence
iterate in interface Sequenceiterate in class AbstractSequenceXPathException - TODOpublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator in interface SequenceunorderedIterator in class AbstractSequencepublic int getItemCount()
Sequence
getItemCount in interface SequencegetItemCount in class AbstractSequencepublic boolean isEmpty()
Sequence
isEmpty in interface SequenceisEmpty in class AbstractSequencetrue is the sequence is emptypublic boolean hasOne()
Sequence
hasOne in interface SequencehasOne in class AbstractSequencetrue is the sequence has just 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 Sequenceadd in class AbstractSequenceXPathException
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 SequenceaddAll in class AbstractSequenceXPathExceptionpublic void sort()
public Item itemAt(int pos)
Sequence
itemAt in interface SequenceitemAt in class AbstractSequencepublic int getItemType()
SequenceType.NODE for node sets, Type.ITEM
for other sequences with mixed items.
getItemType in interface SequencegetItemType in class AbstractSequence
public NodeSet toNodeSet()
throws XPathException
Sequence
XPathException - if the sequence contains items which are not nodes.public boolean isPersistentSet()
isPersistentSet in interface SequenceisPersistentSet in class AbstractSequence
public MemoryNodeSet toMemNodeSet()
throws XPathException
SequenceSequence.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 int getState()
getState in interface SequencegetState in class AbstractSequencepublic boolean hasChanged(int previousState)
hasChanged in interface SequencehasChanged in class AbstractSequencepublic boolean isCacheable()
isCacheable in interface SequenceisCacheable in class AbstractSequence
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||