public interface Item extends GroundedValue
This interface is part of the public Saxon API. As such (starting from Saxon 8.4), methods that form part of the stable API are labelled with a JavaDoc "since" tag to identify the Saxon release at which they were introduced.
Note: there is no method getItemType(). This is to avoid having to implement it on every implementation of NodeInfo. Instead, use the static method Type.getItemType(Item).
| Modifier and Type | Method and Description |
|---|---|
AtomicSequence |
atomize()
Atomize the item.
|
Genre |
getGenre()
Get the genre of this item (to distinguish the top-level categories of item,
such as nodes, atomic values, and functions)
|
default int |
getLength()
Get the size of the value (the number of items)
|
default java.lang.String |
getStringValue()
Get the value of the item as a Java string.
|
UnicodeString |
getUnicodeStringValue()
Get the value of the item as a Unicode string.
|
default Item |
head()
Get the first item in the sequence.
|
default boolean |
isStreamed()
Ask whether this is a node in a streamed document
|
default Item |
itemAt(int n)
Get the n'th item in the value, counting from 0
|
default SingletonIterator |
iterate()
Get an iterator over all the items in the sequence
|
default GroundedValue |
reduce()
Reduce the sequence to its simplest form.
|
default GroundedValue |
subsequence(int start,
int length)
Get a subsequence of the value
|
default java.lang.String |
toShortString()
Provide a short string showing the contents of the item, suitable
for use in error messages
|
asIterable, concatenate, containsNode, effectiveBooleanValue, materializemakeRepeatableGenre getGenre()
default Item head()
Sequence in that
* no exception is thrown.head in interface GroundedValuehead in interface SequenceUnicodeString getUnicodeStringValue()
getUnicodeStringValue in interface GroundedValuejava.lang.UnsupportedOperationException - if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)default java.lang.String getStringValue()
getStringValue in interface GroundedValuejava.lang.UnsupportedOperationException - if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)AtomicSequence atomize() throws XPathException
XPathException - if atomization is not allowed
for this kind of itemdefault java.lang.String toShortString()
toShortString in interface GroundedValuedefault Item itemAt(int n)
itemAt in interface GroundedValuen - the index of the required item, with 0 representing the first item in the sequencedefault GroundedValue subsequence(int start, int length)
subsequence in interface GroundedValuestart - the index of the first item to be included in the result, counting from zero.
A negative value is taken as zero. If the value is beyond the end of the sequence, an empty
sequence is returnedlength - the number of items to be included in the result. Specify Integer.MAX_VALUE to
get the subsequence up to the end of the base sequence. If the value is negative, an empty sequence
is returned. If the value goes off the end of the sequence, the result returns items up to the end
of the sequencedefault int getLength()
getLength in interface GroundedValuedefault SingletonIterator iterate()
iterate in interface GroundedValueiterate in interface Sequencedefault GroundedValue reduce()
reduce in interface GroundedValuedefault boolean isStreamed()
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.