Class FrequencySortedSet.Iter

java.lang.Object
org.apache.sis.util.collection.FrequencySortedSet.Iter
All Implemented Interfaces:
Iterator<E>
Enclosing class:
FrequencySortedSet<E>

private final class FrequencySortedSet.Iter extends Object implements Iterator<E>
Iterator over sorted elements.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final E[]
    A copy of FrequencySortedSet.sorted at the time this iterator has been created.
    private int
    Index of the next element to return.
    private final int
    Index of the first element (lower) and index after the last element (upper) on which to iterate.
    private final int
    Index of the first element (lower) and index after the last element (upper) on which to iterate.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Iter(E[] sorted, int lower, int upper)
    Creates an new iterator.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if there is more elements to return.
    Return the next element.
    void
    Remove the last elements returned by next().

    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

    • elements

      private final E[] elements
      A copy of FrequencySortedSet.sorted at the time this iterator has been created. Used because the sorted array is set to null when remove() is invoked.
    • lower

      private final int lower
      Index of the first element (lower) and index after the last element (upper) on which to iterate.
    • upper

      private final int upper
      Index of the first element (lower) and index after the last element (upper) on which to iterate.
    • index

      private int index
      Index of the next element to return.
  • Constructor Details

    • Iter

      Iter(E[] sorted, int lower, int upper)
      Creates an new iterator.
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if there is more elements to return.
      Specified by:
      hasNext in interface Iterator<E>
    • next

      public E next()
      Return the next element.
      Specified by:
      next in interface Iterator<E>
    • remove

      public void remove()
      Remove the last elements returned by next().
      Specified by:
      remove in interface Iterator<E>