|
|||||||
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. |
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()
Return the type of this item according to the type constants defined in class 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. |
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 |
Methods inherited from interface org.exist.xquery.value.Item |
---|
convertTo |
Methods inherited from interface org.exist.xquery.value.Sequence |
---|
convertTo |
Field Detail |
---|
public static final AtomicValue EMPTY_VALUE
Constructor Detail |
---|
public AtomicValue()
Method Detail |
---|
public int getType()
Item
Type
.
getType
in interface Indexable
getType
in interface Item
public abstract String getStringValue() throws XPathException
Item
getStringValue
in interface Item
getStringValue
in interface Sequence
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 Sequence
public int getCardinality()
Sequence
Cardinality
.
getCardinality
in interface Sequence
Cardinality
public void removeDuplicates()
Sequence
removeDuplicates
in interface Sequence
public SequenceIterator iterate() throws XPathException
Sequence
iterate
in interface Sequence
XPathException
- TODOpublic SequenceIterator unorderedIterator()
Sequence
unorderedIterator
in interface Sequence
public int getItemType()
Sequence
Type.NODE
for node sets, Type.ITEM
for other sequences with mixed items.
getItemType
in interface Sequence
public Item itemAt(int pos)
Sequence
itemAt
in interface Sequence
public Sequence toSequence()
Item
toSequence
in interface Item
public void toSAX(DBBroker broker, ContentHandler handler, Properties properties) throws SAXException
toSAX
in interface Item
SAXException
public void copyTo(DBBroker broker, DocumentBuilderReceiver receiver) throws SAXException
copyTo
in interface Item
SAXException
public boolean isEmpty()
Sequence
isEmpty
in interface Sequence
true
is the sequence is emptypublic 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 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 AtomicValue atomize() throws XPathException
atomize
in interface Item
XPathException
public abstract boolean effectiveBooleanValue() throws XPathException
Sequence
effectiveBooleanValue
in interface Sequence
XPathException
public NodeSet toNodeSet() throws XPathException
Sequence
toNodeSet
in interface Sequence
XPathException
- if the sequence contains items which are not nodes.public DocumentSet getDocumentSet()
Sequence
getDocumentSet
in interface Sequence
public Iterator getCollectionIterator()
Sequence
getCollectionIterator
in interface Sequence
public AtomicValue promote(AtomicValue otherValue) throws XPathException
XPathException
public void dump(ExpressionDumper dumper)
dumper
- public int conversionPreference(Class javaClass)
Sequence
conversionPreference
in interface Item
conversionPreference
in interface Sequence
public Object toJavaObject(Class target) throws XPathException
Sequence
toJavaObject
in interface Item
toJavaObject
in interface Sequence
XPathException
public String toString()
toString
in class Object
public boolean isCached()
Sequence
isCached
in interface Sequence
public void setIsCached(boolean cached)
Sequence
setIsCached
in interface Sequence
public void clearContext(int contextId)
Sequence
clearContext
in interface Sequence
public void setSelfAsContext(int contextId)
setSelfAsContext
in interface Sequence
public boolean isPersistentSet()
isPersistentSet
in interface Sequence
public void nodeMoved(NodeId oldNodeId, StoredNode newNode)
Item
nodeMoved
in interface Item
nodeMoved
in interface Sequence
UpdateListener
public byte[] serializeValue(int offset) throws EXistException
Indexable
serializeValue
in interface Indexable
offset
- starting index for writing in array data
EXistException
public int compareTo(Object other)
compareTo
in interface Comparable
public int getState()
getState
in interface Sequence
public boolean hasChanged(int previousState)
hasChanged
in interface Sequence
public boolean isCacheable()
isCacheable
in interface Sequence
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |