public interface GroundedValue<T extends Item<?>> extends Sequence<T>, java.lang.Iterable<T>
Modifier and Type | Method and Description |
---|---|
default java.lang.Iterable<T> |
asIterable()
Get the contents of this value in the form of a Java
Iterable ,
so that it can be used in a for-each expression. |
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.
|
T |
head()
Get the first item of the sequence.
|
T |
itemAt(int n)
Get the n'th item in the value, counting from zero (0)
|
UnfailingIterator<T> |
iterate()
Get an iterator over all the items in the sequence.
|
default java.util.Iterator<T> |
iterator()
Get an iterator (a Java
Iterator ) over the items in this sequence. |
default GroundedValue<T> |
materialize()
Create a
GroundedValue containing the same items as this Sequence. |
default GroundedValue<T> |
reduce()
Reduce the sequence to its simplest form.
|
GroundedValue<T> |
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<T> iterate()
iterate
in interface Sequence<T extends Item<?>>
SequenceIterator
rather than a Java
Iterator
) over all the items in this Sequence.T itemAt(int n)
n
- the index of the required item, with zero (0) representing the first item in the sequenceT head()
GroundedValue<T> 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<T> reduce()
default GroundedValue<T> 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<T extends Item<?>>
GroundedValue
default java.lang.String toShortString()
default java.lang.Iterable<T> asIterable()
Iterable
,
so that it can be used in a for-each expression. For GroundedValue
and all
its subclasses, the class implements Iterable
directly, so this
method returns this object itself.asIterable
in interface Sequence<T extends Item<?>>
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.