|
|||||||
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(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. |
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()
|
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)
|
Object |
toJavaObject(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. |
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
-
XPathException
int getItemType()
Type.NODE
for node sets, Type.ITEM
for other sequences with mixed items.
SequenceIterator iterate() throws XPathException
XPathException
- TODOSequenceIterator unorderedIterator()
int 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
.
Cardinality
Item 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
String getStringValue() throws XPathException
XPathException
boolean effectiveBooleanValue() throws XPathException
XPathException
NodeSet toNodeSet() throws XPathException
XPathException
- if the sequence contains items which are not nodes.DocumentSet getDocumentSet()
Iterator getCollectionIterator()
int conversionPreference(Class javaClass)
javaClass
- Object toJavaObject(Class target) throws XPathException
target
-
XPathException
boolean isCached()
void setIsCached(boolean cached)
cached
- void clearContext(int contextId)
void setSelfAsContext(int contextId)
boolean isPersistentSet()
void nodeMoved(NodeId oldNodeId, StoredNode newNode)
oldNodeId
- newNode
- UpdateListener
boolean isCacheable()
int getState()
boolean hasChanged(int previousState)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |