|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exist.xquery.value.AtomicValue
Represents an atomic value. All simple values that are not nodes extend AtomicValue. As every single item is also a sequence, this class implements both: Item and Sequence.
| Field Summary | |
static AtomicValue |
EMPTY_VALUE
An empty atomic value |
| Fields inherited from interface org.exist.xquery.value.Sequence |
EMPTY_SEQUENCE |
| Constructor Summary | |
AtomicValue()
|
|
| 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. |
AtomicValue |
atomize()
|
void |
clearContext(int contextId)
For every item in the sequence, clear any context-dependant information that is stored during query processing. |
abstract int |
compareTo(java.text.Collator collator,
AtomicValue other)
|
abstract boolean |
compareTo(java.text.Collator collator,
int operator,
AtomicValue other)
|
boolean |
contains(java.text.Collator collator,
AtomicValue other)
Compares this atomic value to another. |
int |
conversionPreference(java.lang.Class javaClass)
Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. |
abstract AtomicValue |
convertTo(int requiredType)
Convert this item into an atomic value, whose type corresponds to the specified target type. |
void |
copyTo(DBBroker broker,
DocumentBuilderReceiver receiver)
|
void |
dump(ExpressionDumper dumper)
Dump a string representation of this value to the given ExpressionDumper. |
boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence. |
boolean |
endsWith(java.text.Collator collator,
AtomicValue other)
Compares this atomic value to another. |
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. |
abstract java.lang.String |
getStringValue()
Return the string value of this item (see the definition of string value in XPath). |
int |
getType()
Return the type of this item according to the type constants defined in class Type. |
boolean |
isCached()
Returns true if the sequence is the result of a previous operation and has been cached. |
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. |
abstract AtomicValue |
max(java.text.Collator collator,
AtomicValue other)
|
abstract AtomicValue |
min(java.text.Collator collator,
AtomicValue other)
|
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)
|
boolean |
startsWith(java.text.Collator collator,
AtomicValue other)
Compares this atomic value to another. |
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. |
void |
toSAX(DBBroker broker,
org.xml.sax.ContentHandler handler)
|
Sequence |
toSequence()
Convert this item into a sequence, containing only the item. |
java.lang.String |
toString()
|
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final AtomicValue EMPTY_VALUE
| Constructor Detail |
public AtomicValue()
| Method Detail |
public int getType()
ItemType.
getType in interface Item
public abstract java.lang.String getStringValue()
throws XPathException
Item
getStringValue in interface ItemXPathException
public abstract AtomicValue convertTo(int requiredType)
throws XPathException
ItemType. An XPathException is thrown
if the conversion is impossible.
convertTo in interface ItemrequiredType -
XPathException
public abstract boolean compareTo(java.text.Collator collator,
int operator,
AtomicValue other)
throws XPathException
XPathException
public abstract int compareTo(java.text.Collator collator,
AtomicValue other)
throws XPathException
XPathException
public abstract AtomicValue max(java.text.Collator collator,
AtomicValue other)
throws XPathException
XPathException
public abstract AtomicValue min(java.text.Collator collator,
AtomicValue other)
throws XPathException
XPathException
public boolean startsWith(java.text.Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.
public boolean endsWith(java.text.Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.
public boolean contains(java.text.Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.public int getLength()
Sequence
getLength in interface Sequencepublic int getCardinality()
SequenceCardinality.
getCardinality in interface SequenceCardinalitypublic void removeDuplicates()
Sequence
removeDuplicates in interface Sequencepublic SequenceIterator iterate()
Sequence
iterate in interface Sequencepublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator in interface Sequencepublic int getItemType()
SequenceType.NODE for node sets, Type.ITEM
for other sequences with mixed items.
getItemType in interface Sequencepublic Item itemAt(int pos)
Sequence
itemAt in interface Sequencepos -
public Sequence toSequence()
Item
toSequence in interface Item
public void toSAX(DBBroker broker,
org.xml.sax.ContentHandler handler)
throws org.xml.sax.SAXException
toSAX in interface Itemorg.xml.sax.SAXException
public void copyTo(DBBroker broker,
DocumentBuilderReceiver receiver)
throws org.xml.sax.SAXException
copyTo in interface Itemorg.xml.sax.SAXException
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 Sequenceitem -
XPathException
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 Sequenceother -
XPathException
public AtomicValue atomize()
throws XPathException
atomize in interface ItemXPathException
public boolean effectiveBooleanValue()
throws XPathException
Sequence
effectiveBooleanValue in interface SequenceXPathException
public NodeSet toNodeSet()
throws XPathException
Sequence
toNodeSet in interface SequenceXPathException - if the sequence contains items which are not nodes.public DocumentSet getDocumentSet()
Sequence
getDocumentSet in interface Sequencepublic void dump(ExpressionDumper dumper)
dumper - public int conversionPreference(java.lang.Class javaClass)
Sequence
conversionPreference in interface Item
public java.lang.Object toJavaObject(java.lang.Class target)
throws XPathException
Sequence
toJavaObject in interface ItemXPathExceptionpublic java.lang.String toString()
public boolean isCached()
Sequence
isCached in interface Sequencepublic void setIsCached(boolean cached)
Sequence
setIsCached in interface Sequencecached - public void clearContext(int contextId)
Sequence
clearContext in interface Sequencepublic void setSelfAsContext(int contextId)
setSelfAsContext in interface Sequencepublic boolean isPersistentSet()
isPersistentSet in interface Sequence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||