|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Sequence
This interface represents a sequence as defined in the XPath 2.0 specification.
A sequence is a sequence of items. Each item is either an atomic value or a
node. A single item is also a sequence, containing only the item. The base classes for
atomic values and nodes thus implement the Sequence interface.
Also, a node set is a special type of sequence, where all
items are of type node.
| Field Summary | |
|---|---|
static Sequence |
EMPTY_SEQUENCE
Constant representing an empty sequence, i.e. |
| 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. |
java.util.Iterator<Collection> |
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()
|
java.lang.String |
getStringValue()
Convert the sequence to a string. |
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. |
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 |
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. |
MemoryNodeSet |
toMemNodeSet()
Convert the sequence into an in-memory node set. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
| Field Detail |
|---|
static final Sequence EMPTY_SEQUENCE
| Method Detail |
|---|
void add(Item item)
throws XPathException
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.
item -
XPathException
void addAll(Sequence other)
throws XPathException
XPathException may
be thrown if the type of the items in the other sequence is incompatible with
the primary type of this sequence.
other -
XPathExceptionint getItemType()
Type.NODE for node sets, Type.ITEM
for other sequences with mixed items.
SequenceIterator iterate()
throws XPathException
XPathException - TODO
SequenceIterator unorderedIterator()
throws XPathException
XPathExceptionint getItemCount()
boolean isEmpty()
true is the sequence is emptyboolean hasOne()
true is the sequence has just one itemboolean hasMany()
true is the sequence more than one itemvoid removeDuplicates()
int getCardinality()
Cardinality.
CardinalityItem itemAt(int pos)
pos -
AtomicValue convertTo(int requiredType)
throws XPathException
Type. An XPathException
is thrown if the conversion is impossible.
requiredType - one of the type constants defined in class Type
XPathException
java.lang.String getStringValue()
throws XPathException
XPathException
boolean effectiveBooleanValue()
throws XPathException
XPathException
NodeSet toNodeSet()
throws XPathException
XPathException - if the sequence contains items which are not nodes.
MemoryNodeSet toMemNodeSet()
throws XPathException
isPersistentSet() to check
if the sequence is a persistent node set.
XPathException - if the sequence contains items which are not nodes or is
a persistent node setDocumentSet getDocumentSet()
java.util.Iterator<Collection> getCollectionIterator()
int conversionPreference(java.lang.Class<?> javaClass)
javaClass -
java.lang.Object toJavaObject(java.lang.Class<?> target)
throws XPathException
target -
XPathExceptionboolean isCached()
void setIsCached(boolean cached)
cached -
void clearContext(int contextId)
throws XPathException
XPathException
void setSelfAsContext(int contextId)
throws XPathException
XPathExceptionboolean isPersistentSet()
void nodeMoved(NodeId oldNodeId,
StoredNode newNode)
oldNodeId - newNode - UpdateListenerboolean isCacheable()
int getState()
boolean hasChanged(int previousState)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||