|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. |
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. |
java.lang.String |
getStringValue()
Convert the sequence to a string. |
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 |
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 |
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. |
NodeSet |
toNodeSet()
Convert the sequence into a NodeSet. |
SequenceIterator |
unorderedIterator()
Returns an iterator over all items in the sequence. |
Field Detail |
public static final Sequence EMPTY_SEQUENCE
Method Detail |
public 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
public 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
public int getItemType()
Type.NODE
for node sets, Type.ITEM
for other sequences with mixed items.
public SequenceIterator iterate() throws XPathException
XPathException
- TODO
XPathException
- TODOpublic SequenceIterator unorderedIterator()
public int getLength()
public boolean isEmpty()
true
is the sequence is emptypublic boolean hasOne()
true
is the sequence has just one itempublic boolean hasMany()
true
is the sequence more than one itempublic void removeDuplicates()
public int getCardinality()
Cardinality
.
Cardinality
public Item itemAt(int pos)
pos
- public 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
public java.lang.String getStringValue() throws XPathException
XPathException
public boolean effectiveBooleanValue() throws XPathException
XPathException
public NodeSet toNodeSet() throws XPathException
XPathException
- if the sequence contains items which are not nodes.public DocumentSet getDocumentSet()
public int conversionPreference(java.lang.Class javaClass)
javaClass
- public java.lang.Object toJavaObject(java.lang.Class target) throws XPathException
target
-
XPathException
public boolean isCached()
public void setIsCached(boolean cached)
cached
- public void clearContext(int contextId)
public void setSelfAsContext(int contextId)
public boolean isPersistentSet()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |