public interface GroundedValue extends Sequence
Modifier and Type | Method and Description |
---|---|
default java.lang.Iterable<? extends Item> |
asIterable() |
default GroundedValue |
concatenate(GroundedValue... others)
Append two or more grounded values to form a new grounded value
|
default boolean |
containsNode(NodeInfo sought)
Determine whether a particular node is present in the value
|
default boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence
|
int |
getLength()
Get the size of the value (the number of items in the value, considered as a sequence)
|
java.lang.String |
getStringValue()
Get the string value of this sequence.
|
java.lang.CharSequence |
getStringValueCS()
Get the string value of this sequence.
|
Item |
head()
Get the first item of the sequence.
|
Item |
itemAt(int n)
Get the n'th item in the value, counting from zero (0)
|
UnfailingIterator |
iterate()
Get an iterator over all the items in the sequence.
|
default GroundedValue |
materialize()
Create a
GroundedValue containing the same items as this Sequence. |
default GroundedValue |
reduce()
Reduce the sequence to its simplest form.
|
GroundedValue |
subsequence(int start,
int length)
Get a subsequence of the value
|
default java.lang.String |
toShortString()
Produce a short representation of the value of the sequence, suitable for use in error messages
|
makeRepeatable
UnfailingIterator iterate()
iterate
in interface Sequence
SequenceIterator
rather than a Java
Iterator
) over all the items in this Sequence.Item itemAt(int n)
n
- the index of the required item, with zero (0) representing the first item in the sequenceItem head()
GroundedValue subsequence(int start, int length)
start
- 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 length goes off the end of the sequence, the result returns items up to the end
of the sequenceint getLength()
default boolean effectiveBooleanValue() throws XPathException
XPathException
- if the sequence has no effective boolean value (for example a sequence of two integers)java.lang.String getStringValue() throws XPathException
XPathException
- if the sequence contains items that have no string value (for example, function items)java.lang.CharSequence getStringValueCS() throws XPathException
XPathException
- if the sequence contains items that have no string value (for example, function items)default GroundedValue reduce()
default GroundedValue materialize()
GroundedValue
containing the same items as this Sequence.
Since this Sequence is already a GroundedValue
this method returns
this GroundedValue
unchanged.materialize
in interface Sequence
GroundedValue
default java.lang.String toShortString()
default java.lang.Iterable<? extends Item> asIterable()
default boolean containsNode(NodeInfo sought) throws XPathException
sought
- the sought-after nodeXPathException
- This should never happendefault GroundedValue concatenate(GroundedValue... others)
others
- one or more grounded values that are to be concatenated with this
one, in orderCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.