Class RangeSet.Iter

java.lang.Object
org.apache.sis.util.collection.RangeSet.Iter
All Implemented Interfaces:
Iterator<Range<E>>
Direct Known Subclasses:
RangeSet.SubIter
Enclosing class:
RangeSet<E extends Comparable<? super E>>

private class RangeSet.Iter extends Object implements Iterator<Range<E>>
The iterator returned by RangeSet.iterator(). All elements are Range objects.
Since:
0.3
Version:
0.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) boolean
    true if the remove() method can be invoked.
    (package private) int
    Modification count at construction time.
    (package private) int
    Current position in RangeSet.array.
    (package private) final int
    Index after the last element in the RangeSet.array where to iterate.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Iter(int upper)
    Creates a new iterator for the given portion of the RangeSet.array.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Returns true if the iteration has more elements.
    Returns the next element in the iteration.
    void
    Removes from the underlying collection the last element returned by the iterator.

    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

    • modCount

      int modCount
      Modification count at construction time.
    • upper

      final int upper
      Index after the last element in the RangeSet.array where to iterate.
    • position

      int position
      Current position in RangeSet.array.
    • canRemove

      boolean canRemove
      true if the remove() method can be invoked.
  • Constructor Details

    • Iter

      Iter(int upper)
      Creates a new iterator for the given portion of the RangeSet.array.
  • Method Details

    • hasNext

      public final boolean hasNext()
      Returns true if the iteration has more elements.
      Specified by:
      hasNext in interface Iterator<Range<E extends Comparable<? super E>>>
    • next

      public Range<E> next()
      Returns the next element in the iteration.
      Specified by:
      next in interface Iterator<Range<E extends Comparable<? super E>>>
    • remove

      public void remove()
      Removes from the underlying collection the last element returned by the iterator.
      Specified by:
      remove in interface Iterator<Range<E extends Comparable<? super E>>>