public abstract class ArrayIterator extends java.lang.Object implements SequenceIterator, LastPositionFinder, LookaheadIterator, GroundedIterator, ReversibleIterator
ArrayIterator
class, with
ArrayIterator.Of<T extends Item>
as a subclass. A further subtlety
is that we need an ArrayIterator of nodes to implement AxisIterator
,
so we have another subclass ArrayIterator.OfNodes<N extends NodeInfo>
for that purpose.Modifier and Type | Class and Description |
---|---|
static class |
ArrayIterator.Of<T extends Item>
Parameterised subclass to accept items of a particular item type
|
static class |
ArrayIterator.OfNodes<N extends NodeInfo>
ArrayIterator.OfNodes is a subclass of ArrayIterator where the array always
contains Nodes; it therefore implements the AxisIterator interface.
|
Modifier and Type | Field and Description |
---|---|
protected int |
end |
protected int |
index |
protected int |
start |
Constructor and Description |
---|
ArrayIterator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isActuallyGrounded()
Ask if the iterator is actually grounded.
|
abstract SequenceIterator |
makeSliceIterator(int min,
int max)
Create a new ArrayIterator over the same items,
with a different start point and end point
|
boolean |
supportsHasNext()
Ask whether the hasNext() method can be called.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLength, supportsGetLength
hasNext
getResidue, materialize
getReverseIterator
close, discharge, next
public abstract SequenceIterator makeSliceIterator(int min, int max)
min
- the start position (1-based) of the new ArrayIterator
relative to the originalmax
- the end position (1-based) of the last item to be delivered
by the new ArrayIterator, relative to the original. For example, min=2, max=3
delivers the two items ($base[2], $base[3]). Set this to Integer.MAX_VALUE if
there is no end limit.public boolean isActuallyGrounded()
GroundedIterator
GroundedIterator.materialize()
or GroundedIterator.getResidue()
, because the iterator might
be grounded under some conditions and not others (usually when it delegates
to another iterator)isActuallyGrounded
in interface GroundedIterator
public boolean supportsHasNext()
LookaheadIterator
supportsHasNext
in interface LookaheadIterator
LookaheadIterator.hasNext()
method is availableCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.