net.sf.saxon.s9api
public class XdmValue extends Object implements Iterable<XdmItem>
An XdmValue is immutable.
A sequence consisting of a single item may be represented as an instance of XdmItem, which is a subtype of XdmValue. However, there is no guarantee that a sequence of length one will always be an instance of XdmItem.
Similarly, a zero-length sequence may be represented as an instance of XdmEmptySequence, but there is no guarantee that every sequence of length zero will always be an instance of XdmEmptySequence.
Since: 9.0
Constructor Summary | |
---|---|
protected | XdmValue() |
XdmValue(Iterable<XdmItem> items)
Create an XdmValue as a sequence of XdmItem objects | |
protected | XdmValue(ValueRepresentation value) |
Method Summary | |
---|---|
XdmValue | append(XdmValue otherValue)
Create a new XdmValue by concatenating the contents of this XdmValue and another
XdmValue. |
ValueRepresentation | getUnderlyingValue()
Get the underlying implementation object representing the value. |
XdmItem | itemAt(int n)
Get the n'th item in the value, counting from zero. |
XdmSequenceIterator | iterator()
Get an iterator over the items in this value. |
protected void | setValue(ValueRepresentation value) |
int | size()
Get the number of items in the sequence |
protected static XdmValue | wrap(ValueRepresentation value) |
Parameters: items a sequence of XdmItem objects. Note that if this is supplied as a list or similar collection, subsequent changes to the list/collection will have no effect on the XdmValue.
Since: 9.0.0.4
Parameters: otherValue the value to be appended
Returns: a new XdmValue containing the concatenation of the two input XdmValue objects
Since: 9.2
Returns: the underlying implementation object representing the value
Parameters: n the item that is required, counting the first item in the sequence as item zero
Returns: the n'th item in the sequence making up the value, counting from zero
Throws: IndexOutOfBoundsException if n is less than zero or greater than or equal to the number of items in the value SaxonApiUncheckedException if the value is lazily evaluated and the delayed evaluation fails with a dynamic error.
Returns: an Iterator over the items in this value.
Throws: SaxonApiUncheckedException if the value is lazily evaluated and the delayed evaluation fails with a dynamic error.
Returns: the number of items in the value
Throws: SaxonApiUncheckedException if the value is lazily evaluated and the delayed evaluation fails with a dynamic error.