Class CodeListSet.Iter

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

private final class CodeListSet.Iter extends Object implements Iterator<E>
The iterator returned by CodeListSet.iterator().
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Ordinal value of the last element returned by next(), or -1 if none.
    private final BitSet
    Initialized to a clone of CodeListSet.supplementary, then the bits are cleared as we progress in the iteration.
    private long
    Initialized to CodeListSet.values, then the bits are cleared as we progress in the iteration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Iter(long values, BitSet supplementary)
    Creates a new iterator initialized to the given values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if there is more elements to return.
    Returns the next element.
    void
    Removes the last element returned by this 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

    • remaining

      private long remaining
      Initialized to CodeListSet.values, then the bits are cleared as we progress in the iteration. This value become 0 when the iteration is done.
    • more

      private final BitSet more
      Initialized to a clone of CodeListSet.supplementary, then the bits are cleared as we progress in the iteration. The bit set become empty when the iteration is done.
    • last

      private int last
      Ordinal value of the last element returned by next(), or -1 if none.
  • Constructor Details

    • Iter

      Iter(long values, BitSet supplementary)
      Creates a new iterator initialized to the given values.
  • Method Details

    • hasNext

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

      public E next()
      Returns the next element.
      Specified by:
      next in interface Iterator<E extends org.opengis.util.CodeList<E>>
    • remove

      public void remove()
      Removes the last element returned by this iterator.
      Specified by:
      remove in interface Iterator<E extends org.opengis.util.CodeList<E>>