Class ObjectHashSet.ObjectIterator

  • All Implemented Interfaces:
    java.util.Iterator<T>
    Enclosing class:
    ObjectHashSet<T>

    public final class ObjectHashSet.ObjectIterator
    extends java.lang.Object
    implements java.util.Iterator<T>
    Iterator over the set which can be optionally cached to avoid allocation.
    • Field Detail

      • remaining

        private int remaining
      • positionCounter

        private int positionCounter
      • stopCounter

        private int stopCounter
      • isPositionValid

        private boolean isPositionValid
    • Constructor Detail

      • ObjectIterator

        public ObjectIterator()
        Creates a new instance.
    • Method Detail

      • remaining

        public int remaining()
        Return number of remaining elements.
        Returns:
        number of remaining elements.
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • nextValue

        public T nextValue()
        Get the next value.
        Returns:
        the next value.
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • position

        private int position​(T[] values)