|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xquery.value.AbstractSequence
public abstract class AbstractSequence
An abstract implementation of Sequence
with
default implementations for some methods.
Field Summary |
---|
Fields inherited from interface org.exist.xquery.value.Sequence |
---|
EMPTY_SEQUENCE |
Method Summary | |
---|---|
abstract 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. |
void |
clearContext(int contextId)
For every item in the sequence, clear any context-dependant information that is stored during query processing. |
int |
conversionPreference(Class javaClass)
Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. |
AtomicValue |
convertTo(int requiredType)
Try to convert the sequence into an atomic value. |
boolean |
effectiveBooleanValue()
See 2.4.3 Effective Boolean Value |
int |
getCardinality()
Returns the cardinality of this sequence. |
Iterator |
getCollectionIterator()
Return an iterator on all collections referenced by documents contained in this sequence.. |
DocumentSet |
getDocumentSet()
Returns the set of documents from which the node items in this sequence have been selected. |
abstract int |
getItemCount()
Returns the number of items contained in the sequence. |
abstract int |
getItemType()
Return the primary type to which all items in this sequence belong. |
int |
getState()
|
String |
getStringValue()
Convert the sequence to a string. |
boolean |
hasChanged(int previousState)
|
boolean |
hasMany()
Returns whether the sequence more than one item or not. |
abstract boolean |
hasOne()
Returns whether the sequence has just one item or not. |
boolean |
isCacheable()
|
boolean |
isCached()
Returns true if the sequence is the result of a previous operation and has been cached. |
abstract boolean |
isEmpty()
Returns whether the sequence is empty or not. |
boolean |
isPersistentSet()
|
abstract Item |
itemAt(int pos)
Returns the item located at the specified position within this sequence. |
abstract SequenceIterator |
iterate()
Returns an iterator over all items in the sequence. |
void |
nodeMoved(NodeId oldNodeId,
StoredNode newNode)
Node sets may implement this method to be informed of storage address and node id changes after updates. |
void |
setIsCached(boolean cached)
Indicates that the sequence is the result of a previous operation and has not been recomputed. |
void |
setSelfAsContext(int contextId)
|
Object |
toJavaObject(Class target)
Convert the value into an instance of the specified Java class. |
String |
toString()
|
abstract SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exist.xquery.value.Sequence |
---|
removeDuplicates, toMemNodeSet, toNodeSet |
Method Detail |
---|
public abstract int getItemType()
Sequence
Type.NODE
for node sets, Type.ITEM
for other sequences with mixed items.
getItemType
in interface Sequence
public abstract SequenceIterator iterate() throws XPathException
Sequence
iterate
in interface Sequence
XPathException
- TODOpublic abstract SequenceIterator unorderedIterator() throws XPathException
Sequence
unorderedIterator
in interface Sequence
XPathException
public abstract int getItemCount()
Sequence
getItemCount
in interface Sequence
public int getCardinality()
Sequence
Cardinality
.
getCardinality
in interface Sequence
Cardinality
public AtomicValue convertTo(int requiredType) throws XPathException
Sequence
Type
. An XPathException
is thrown if the conversion is impossible.
convertTo
in interface Sequence
requiredType
- one of the type constants defined in class Type
XPathException
public abstract boolean isEmpty()
Sequence
isEmpty
in interface Sequence
true
is the sequence is emptypublic abstract boolean hasOne()
Sequence
hasOne
in interface Sequence
true
is the sequence has just one itempublic boolean hasMany()
Sequence
hasMany
in interface Sequence
true
is the sequence more than one itempublic String getStringValue() throws XPathException
Sequence
getStringValue
in interface Sequence
XPathException
public String toString()
toString
in class Object
public abstract 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
XPathException
public void addAll(Sequence other) throws XPathException
Sequence
XPathException
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 Sequence
XPathException
public abstract Item itemAt(int pos)
Sequence
itemAt
in interface Sequence
public DocumentSet getDocumentSet()
Sequence
getDocumentSet
in interface Sequence
public Iterator getCollectionIterator()
Sequence
getCollectionIterator
in interface Sequence
public void nodeMoved(NodeId oldNodeId, StoredNode newNode)
Sequence
nodeMoved
in interface Sequence
UpdateListener
public boolean effectiveBooleanValue() throws XPathException
effectiveBooleanValue
in interface Sequence
XPathException
Sequence.effectiveBooleanValue()
public int conversionPreference(Class javaClass)
Sequence
conversionPreference
in interface Sequence
public Object toJavaObject(Class target) throws XPathException
Sequence
toJavaObject
in interface Sequence
XPathException
public void clearContext(int contextId) throws XPathException
Sequence
clearContext
in interface Sequence
XPathException
public void setSelfAsContext(int contextId) throws XPathException
setSelfAsContext
in interface Sequence
XPathException
public boolean isCached()
Sequence
isCached
in interface Sequence
public void setIsCached(boolean cached)
Sequence
setIsCached
in interface Sequence
public boolean isPersistentSet()
isPersistentSet
in interface Sequence
public boolean isCacheable()
isCacheable
in interface Sequence
public int getState()
getState
in interface Sequence
public boolean hasChanged(int previousState)
hasChanged
in interface Sequence
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |