Class PrimitiveIntCollections.PrimitiveIntBaseIterator

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean fetchNext()
      Fetches the next item in this iterator.
      boolean hasNext()  
      int next()  
      protected boolean next​(int nextItem)
      Called from inside an implementation of fetchNext() if a next item was found.
      • Methods inherited from class java.lang.Object

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

      • PrimitiveIntBaseIterator

        public PrimitiveIntBaseIterator()
    • Method Detail

      • fetchNext

        protected abstract boolean fetchNext()
        Fetches the next item in this iterator. Returns whether or not a next item was found. If a next item was found, that value must have been set inside the implementation of this method using next(int).
      • next

        protected boolean next​(int nextItem)
        Called from inside an implementation of fetchNext() if a next item was found. This method returns true so that it can be used in short-hand conditionals (TODO what are they called?), like:
         @Override
         protected boolean fetchNext()
         {
             return source.hasNext() ? next( source.next() ) : false;
         }
         
        Parameters:
        nextItem - the next item found.