|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.xquery.value.AtomicValue
public abstract class 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(Collator collator,
AtomicValue other)
|
abstract boolean |
compareTo(Collator collator,
int operator,
AtomicValue other)
|
int |
compareTo(Object other)
|
boolean |
contains(Collator collator,
AtomicValue other)
Compares this atomic value to another. |
int |
conversionPreference(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. |
abstract boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence. |
boolean |
endsWith(Collator collator,
AtomicValue other)
Compares this atomic value to another. |
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. |
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()
|
abstract String |
getStringValue()
Return the string value of this item (see the definition of string value in XPath). |
int |
getType()
Returns the type of the Indexable as one of the constants defined in Type. |
boolean |
hasChanged(int previousState)
|
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 |
isCacheable()
|
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. |
abstract AtomicValue |
max(Collator collator,
AtomicValue other)
|
abstract AtomicValue |
min(Collator collator,
AtomicValue other)
|
void |
nodeMoved(NodeId oldNodeId,
StoredNode newNode)
Nodes may implement this method to be informed of storage address and node id changes after updates. |
AtomicValue |
promote(AtomicValue otherValue)
|
void |
removeDuplicates()
Explicitely remove all duplicate nodes from this sequence. |
byte[] |
serializeValue(int offset)
Serialize the value to an array of bytes for the persistant storage. |
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(Collator collator,
AtomicValue other)
Compares this atomic value to another. |
Object |
toJavaObject(Class target)
Convert the value into an instance of the specified Java class. |
MemoryNodeSet |
toMemNodeSet()
Convert the sequence into an in-memory node set. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
void |
toSAX(DBBroker broker,
ContentHandler handler,
Properties properties)
|
Sequence |
toSequence()
Convert this item into a sequence, containing only the item. |
String |
toString()
|
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 |
| Field Detail |
|---|
public static final AtomicValue EMPTY_VALUE
| Constructor Detail |
|---|
public AtomicValue()
| Method Detail |
|---|
public int getType()
IndexableType.
getType in interface IndexablegetType in interface Item
public abstract String getStringValue()
throws XPathException
Item
getStringValue in interface ItemgetStringValue in interface SequenceXPathException
public abstract AtomicValue convertTo(int requiredType)
throws XPathException
ItemType. An XPathException is thrown
if the conversion is impossible.
convertTo in interface ItemconvertTo in interface SequencerequiredType - one of the type constants defined in class Type
XPathException
public abstract boolean compareTo(Collator collator,
int operator,
AtomicValue other)
throws XPathException
XPathException
public abstract int compareTo(Collator collator,
AtomicValue other)
throws XPathException
XPathException
public abstract AtomicValue max(Collator collator,
AtomicValue other)
throws XPathException
XPathException
public abstract AtomicValue min(Collator collator,
AtomicValue other)
throws XPathException
XPathException
public boolean startsWith(Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.
public boolean endsWith(Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.
public boolean contains(Collator collator,
AtomicValue other)
throws XPathException
collator - Collator used for string comparison.other -
XPathException - if this is not a string.public int getItemCount()
Sequence
getItemCount in interface Sequencepublic int getCardinality()
SequenceCardinality.
getCardinality in interface SequenceCardinalitypublic void removeDuplicates()
Sequence
removeDuplicates in interface Sequence
public SequenceIterator iterate()
throws XPathException
Sequence
iterate in interface SequenceXPathException - TODOpublic 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 Sequencepublic Sequence toSequence()
Item
toSequence in interface Item
public void toSAX(DBBroker broker,
ContentHandler handler,
Properties properties)
throws SAXException
toSAX in interface ItemSAXException
public void copyTo(DBBroker broker,
DocumentBuilderReceiver receiver)
throws SAXException
copyTo in interface ItemSAXExceptionpublic boolean isEmpty()
Sequence
isEmpty in interface Sequencetrue is the sequence is emptypublic boolean hasOne()
Sequence
hasOne in interface Sequencetrue is the sequence has just one itempublic boolean hasMany()
Sequence
hasMany in interface Sequencetrue is the sequence more than 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 SequenceXPathException
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 SequenceXPathException
public AtomicValue atomize()
throws XPathException
atomize in interface ItemXPathException
public abstract 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 MemoryNodeSet toMemNodeSet()
throws XPathException
SequenceSequence.isPersistentSet() to check
if the sequence is a persistent node set.
toMemNodeSet in interface SequenceXPathException - if the sequence contains items which are not nodes or is
a persistent node setpublic DocumentSet getDocumentSet()
Sequence
getDocumentSet in interface Sequencepublic Iterator getCollectionIterator()
Sequence
getCollectionIterator in interface Sequence
public AtomicValue promote(AtomicValue otherValue)
throws XPathException
XPathExceptionpublic void dump(ExpressionDumper dumper)
dumper - public int conversionPreference(Class javaClass)
Sequence
conversionPreference in interface ItemconversionPreference in interface Sequence
public Object toJavaObject(Class target)
throws XPathException
Sequence
toJavaObject in interface ItemtoJavaObject in interface SequenceXPathExceptionpublic String toString()
toString in class Objectpublic boolean isCached()
Sequence
isCached in interface Sequencepublic void setIsCached(boolean cached)
Sequence
setIsCached in interface Sequencepublic void clearContext(int contextId)
Sequence
clearContext in interface Sequencepublic void setSelfAsContext(int contextId)
setSelfAsContext in interface Sequencepublic boolean isPersistentSet()
isPersistentSet in interface Sequence
public void nodeMoved(NodeId oldNodeId,
StoredNode newNode)
Item
nodeMoved in interface ItemnodeMoved in interface SequenceUpdateListener
public byte[] serializeValue(int offset)
throws EXistException
Indexable
serializeValue in interface Indexableoffset - starting index for writing in array data
EXistExceptionpublic int compareTo(Object other)
compareTo in interface Comparablepublic int getState()
getState in interface Sequencepublic boolean hasChanged(int previousState)
hasChanged in interface Sequencepublic boolean isCacheable()
isCacheable in interface Sequence
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||