org.exist.xquery
Class DeferredFunctionCall

java.lang.Object
  extended byorg.exist.xquery.DeferredFunctionCall
All Implemented Interfaces:
Sequence

public abstract class DeferredFunctionCall
extends java.lang.Object
implements Sequence


Field Summary
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
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.
 void clearContext(int contextId)
          For every item in the sequence, clear any context-dependant information that is stored during query processing.
 int conversionPreference(java.lang.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()
          Get the effective boolean value of this sequence.
 int getCardinality()
          Returns the cardinality of this sequence.
 DocumentSet getDocumentSet()
          Returns the set of documents from which the node items in this sequence have been selected.
 int getItemType()
          Return the primary type to which all items in this sequence belong.
 int getLength()
          Returns the number of items contained in the sequence.
 java.lang.String getStringValue()
          Convert the sequence to a string.
 boolean hasMany()
          Returns whether the sequence more than one item or not.
 boolean hasOne()
          Returns whether the sequence has just one item or not.
 boolean isCached()
          Returns true if the sequence is the result of a previous operation and has been cached.
 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 setIsCached(boolean cached)
          Indicates that the sequence is the result of a previous operation and has not been recomputed.
 void setSelfAsContext(int contextId)
           
 java.lang.Object toJavaObject(java.lang.Class target)
          Convert the value into an instance of the specified Java class.
 NodeSet toNodeSet()
          Convert the sequence into a NodeSet.
 SequenceIterator unorderedIterator()
          Returns an iterator over all items in the sequence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(Item item)
         throws XPathException
Description copied from interface: Sequence
Add an item to the current sequence. An 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.

Specified by:
add in interface Sequence
Parameters:
item -
Throws:
XPathException

addAll

public void addAll(Sequence other)
            throws XPathException
Description copied from interface: Sequence
Add all items of the other sequence to this item. An XPathException may be thrown if the type of the items in the other sequence is incompatible with the primary type of this sequence.

Specified by:
addAll in interface Sequence
Parameters:
other -
Throws:
XPathException

clearContext

public void clearContext(int contextId)
Description copied from interface: Sequence
For every item in the sequence, clear any context-dependant information that is stored during query processing. This feature is used for node sets, which may store information about their context node.

Specified by:
clearContext in interface Sequence

conversionPreference

public int conversionPreference(java.lang.Class javaClass)
Description copied from interface: Sequence
Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. Low numbers mean that the value can be easily converted into the given class.

Specified by:
conversionPreference in interface Sequence
Parameters:
javaClass -

convertTo

public AtomicValue convertTo(int requiredType)
                      throws XPathException
Description copied from interface: Sequence
Try to convert the sequence into an atomic value. The target type should be specified by using one of the constants defined in class Type. An XPathException is thrown if the conversion is impossible.

Specified by:
convertTo in interface Sequence
Parameters:
requiredType - one of the type constants defined in class Type
Throws:
XPathException

effectiveBooleanValue

public boolean effectiveBooleanValue()
                              throws XPathException
Description copied from interface: Sequence
Get the effective boolean value of this sequence. Will be false if the sequence is empty, true otherwise.

Specified by:
effectiveBooleanValue in interface Sequence
Throws:
XPathException

getCardinality

public int getCardinality()
Description copied from interface: Sequence
Returns the cardinality of this sequence. The returned value is a combination of flags as defined in Cardinality.

Specified by:
getCardinality in interface Sequence
See Also:
Cardinality

getDocumentSet

public DocumentSet getDocumentSet()
Description copied from interface: Sequence
Returns the set of documents from which the node items in this sequence have been selected. This is for internal use only.

Specified by:
getDocumentSet in interface Sequence

getItemType

public int getItemType()
Description copied from interface: Sequence
Return the primary type to which all items in this sequence belong. This is Type.NODE for node sets, Type.ITEM for other sequences with mixed items.

Specified by:
getItemType in interface Sequence
Returns:
the primary type of the items in this sequence.

getLength

public int getLength()
Description copied from interface: Sequence
Returns the number of items contained in the sequence. Call this method only when necessary, since it can be resource consuming.

Specified by:
getLength in interface Sequence
Returns:
The sequence's length

getStringValue

public java.lang.String getStringValue()
                                throws XPathException
Description copied from interface: Sequence
Convert the sequence to a string.

Specified by:
getStringValue in interface Sequence
Throws:
XPathException

hasMany

public boolean hasMany()
Description copied from interface: Sequence
Returns whether the sequence more than one item or not.

Specified by:
hasMany in interface Sequence
Returns:
true is the sequence more than one item

hasOne

public boolean hasOne()
Description copied from interface: Sequence
Returns whether the sequence has just one item or not.

Specified by:
hasOne in interface Sequence
Returns:
true is the sequence has just one item

isCached

public boolean isCached()
Description copied from interface: Sequence
Returns true if the sequence is the result of a previous operation and has been cached.

Specified by:
isCached in interface Sequence

isEmpty

public boolean isEmpty()
Description copied from interface: Sequence
Returns whether the sequence is empty or not.

Specified by:
isEmpty in interface Sequence
Returns:
true is the sequence is empty

isPersistentSet

public boolean isPersistentSet()
Specified by:
isPersistentSet in interface Sequence

itemAt

public Item itemAt(int pos)
Description copied from interface: Sequence
Returns the item located at the specified position within this sequence. Items are counted beginning at 0.

Specified by:
itemAt in interface Sequence
Parameters:
pos -

iterate

public SequenceIterator iterate()
                         throws XPathException
Description copied from interface: Sequence
Returns an iterator over all items in the sequence. The items are returned in document order where applicable.

Specified by:
iterate in interface Sequence
Throws:
XPathException - TODO

removeDuplicates

public void removeDuplicates()
Description copied from interface: Sequence
Explicitely remove all duplicate nodes from this sequence.

Specified by:
removeDuplicates in interface Sequence

setIsCached

public void setIsCached(boolean cached)
Description copied from interface: Sequence
Indicates that the sequence is the result of a previous operation and has not been recomputed.

Specified by:
setIsCached in interface Sequence
Parameters:
cached -

setSelfAsContext

public void setSelfAsContext(int contextId)
Specified by:
setSelfAsContext in interface Sequence

toJavaObject

public java.lang.Object toJavaObject(java.lang.Class target)
                              throws XPathException
Description copied from interface: Sequence
Convert the value into an instance of the specified Java class.

Specified by:
toJavaObject in interface Sequence
Parameters:
target -
Throws:
XPathException

toNodeSet

public NodeSet toNodeSet()
                  throws XPathException
Description copied from interface: Sequence
Convert the sequence into a NodeSet. If the sequence contains items which are not nodes, an XPathException is thrown.

Specified by:
toNodeSet in interface Sequence
Throws:
XPathException - if the sequence contains items which are not nodes.

unorderedIterator

public SequenceIterator unorderedIterator()
Description copied from interface: Sequence
Returns an iterator over all items in the sequence. The returned items may - but need not - to be in document order.

Specified by:
unorderedIterator in interface Sequence


Copyright (C) Wolfgang Meier. All rights reserved.