Class LongRangeIterator

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        LongRangeIterator​(long max)
      Constructs an long number range iterator with the lower bound equal to zero and the increment value equal to one.
        LongRangeIterator​(long min, long max)
      Constructs an long number range iterator with the increment value equal to one.
        LongRangeIterator​(long min, long max, long inc)
      Constructs a range iterator.
      protected LongRangeIterator​(LongRangeIterator other)
      Constructs a copy of the iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LongRangeIterator clone()
      Creates a copy of the iterator.
      boolean hasValue()
      Checks if the iterator is not exhausted (a value is available).
      void init()
      Initializes the iterator.
      void next()
      Makes an iteration.
      void setValue​(long value)
      Sets the current value.
      int size()
      Returns the size of the collection of the iterated items.
      void stop()
      Stops the iterator.
      java.lang.Long value()
      Returns the current value of the iterator.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongRangeIterator

        public LongRangeIterator​(long min,
                                 long max,
                                 long inc)
        Constructs a range iterator.
        Parameters:
        min - the lower bound.
        max - the upper bound.
        inc - the increment value (step).
      • LongRangeIterator

        public LongRangeIterator​(long min,
                                 long max)
        Constructs an long number range iterator with the increment value equal to one.
        Parameters:
        min - the lower bound.
        max - the upper bound.
      • LongRangeIterator

        public LongRangeIterator​(long max)
        Constructs an long number range iterator with the lower bound equal to zero and the increment value equal to one.
        Parameters:
        max - the upper bound.
      • LongRangeIterator

        protected LongRangeIterator​(LongRangeIterator other)
        Constructs a copy of the iterator.
        Parameters:
        other - the iterator to be copied.
    • Method Detail

      • setValue

        public void setValue​(long value)
        Sets the current value.
        Parameters:
        value - the value to set.
      • init

        public void init()
        Description copied from interface: Iterator
        Initializes the iterator.
        Specified by:
        init in interface Iterator<java.lang.Long>
      • hasValue

        public boolean hasValue()
        Description copied from interface: Iterator
        Checks if the iterator is not exhausted (a value is available).
        Specified by:
        hasValue in interface Iterator<java.lang.Long>
        Returns:
        true if the iterator is not exhausted; false otherwise.
      • value

        public java.lang.Long value()
        Description copied from interface: Iterator
        Returns the current value of the iterator.
        Specified by:
        value in interface Iterator<java.lang.Long>
        Returns:
        the current value of the iterator.
      • next

        public void next()
        Description copied from interface: Iterator
        Makes an iteration.
        Specified by:
        next in interface Iterator<java.lang.Long>
      • stop

        public void stop()
        Description copied from interface: Iterator
        Stops the iterator.
        Specified by:
        stop in interface Iterator<java.lang.Long>
      • size

        public int size()
        Description copied from interface: BoundedIterator
        Returns the size of the collection of the iterated items.
        Specified by:
        size in interface BoundedIterator<java.lang.Long>
        Returns:
        the number of items being iterated.
      • clone

        public LongRangeIterator clone()
        Description copied from interface: Iterator
        Creates a copy of the iterator.
        Specified by:
        clone in interface Iterator<java.lang.Long>
        Overrides:
        clone in class java.lang.Object
        Returns:
        A copy of the iterator.