Package org.apache.sis.util.collection
Class RangeSet.SubIter
- Enclosing class:
- RangeSet<E extends Comparable<? super E>>
The iterator returned by
RangeSet.SubSet.iterator()
. This iterator is similar
to the one returned by RangeSet.iterator()
, except that:
- The iteration is restricted to a sub-region of the
RangeSet.array
. - The first and last ranges returned by the iterator are intercepted with the range of the subset (other ranges should not need to be intercepted).
- The range removed by
remove()
is intercepted with the range of the subset.
- Since:
- 0.3
- Version:
- 0.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Index of the first element in theRangeSet.array
where to iterate.A copy of theRangeSet.SubSet.subRange
field value at the time of iterator creation.Fields inherited from class org.apache.sis.util.collection.RangeSet.Iter
canRemove, modCount, position, upper
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.sis.util.collection.RangeSet.Iter
hasNext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
subRange
A copy of theRangeSet.SubSet.subRange
field value at the time of iterator creation. -
lower
private final int lowerIndex of the first element in theRangeSet.array
where to iterate.
-
-
Constructor Details
-
SubIter
Creates a new iterator for the given portion of theRangeSet.array
.
-
-
Method Details
-
isFirstOrLast
private boolean isFirstOrLast()Returnstrue
if the iterator position is at the first or at the last range. This method is accurate only when invoked aftersuper.next()
. -
next
Returns the next element in the iteration. -
remove
public void remove()Removes from the underlying collection the last element returned by the iterator.
-