Package net.sf.saxon.value
Class SequenceExtent
- java.lang.Object
-
- net.sf.saxon.value.SequenceExtent
-
- All Implemented Interfaces:
GroundedValue
,Sequence
- Direct Known Subclasses:
SequenceExtent.Of
public abstract class SequenceExtent extends java.lang.Object implements GroundedValue
A sequence value implemented extensionally. That is, this class represents a sequence by allocating memory to each item in the sequence.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SequenceExtent.Of<T extends Item>
-
Constructor Summary
Constructors Constructor Description SequenceExtent()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SequenceExtent.Of<Item>
from(SequenceIterator iter)
Construct a sequence containing all the remaining items in a SequenceIterator.static GroundedValue
makeResidue(SequenceIterator iter)
Factory method to make a GroundedValue holding the remaining contents of any SequenceIterator, that is, the contents that have not yet been readstatic <T extends Item>
GroundedValuemakeSequenceExtent(java.util.List<T> input)
Factory method to make a Value holding the contents of any List of itemsabstract SequenceIterator
reverseIterate()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, getLength, getStringValue, getUnicodeStringValue, head, itemAt, iterate, materialize, reduce, subsequence, toShortString
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Method Detail
-
from
public static SequenceExtent.Of<Item> from(SequenceIterator iter)
Construct a sequence containing all the remaining items in a SequenceIterator.- Parameters:
iter
- The supplied sequence of items. The returned sequence will contain all items delivered by repeated calls on next() on this iterator, and the iterator will be consumed by calling the method.- Returns:
- a sequence of the remaining items
- Throws:
UncheckedXPathException
- if reading the items using the SequenceIterator raises an error
-
makeResidue
public static GroundedValue makeResidue(SequenceIterator iter)
Factory method to make a GroundedValue holding the remaining contents of any SequenceIterator, that is, the contents that have not yet been read- Parameters:
iter
- a Sequence iterator that may or may not be consumed to deliver the items in the sequence. The iterator need not be positioned at the start.- Returns:
- a GroundedValue holding the items delivered by the SequenceIterator. If the
sequence is empty the result will be an instance of
EmptySequence
. If it is of length one, the result will be anItem
. In all other cases, it will be an instance ofSequenceExtent
. - Throws:
UncheckedXPathException
- if an error occurs processing the values from the iterator.
-
makeSequenceExtent
public static <T extends Item> GroundedValue makeSequenceExtent(java.util.List<T> input)
Factory method to make a Value holding the contents of any List of items- Type Parameters:
T
- the type of items in the list- Parameters:
input
- a List containing the items in the sequence. The caller guarantees that the list will not be subsequently modified.- Returns:
- a grounded sequence holding the items in the list. If the
sequence is empty the result will be an instance of
EmptySequence
. If it is of length one, the result will be anItem
. In all other cases, it will be an instance ofSequenceExtent
.
-
reverseIterate
public abstract SequenceIterator reverseIterate()
-
-