Class Iterators.Abstract<A>

    • Constructor Detail

      • Abstract

        protected Abstract()
        Constructor for use by subclasses.
    • Method Detail

      • computeNext

        protected abstract A computeNext()
        The next element.

        Note: the implementation must call endOfData() when there are no elements left in the iteration. Failure to do so could result in an infinite loop.

      • endOfData

        protected final A endOfData()
        Implementations of computeNext() must invoke this method when there are no elements left in the iteration.
        Returns:
        null; a convenience so your computeNext implementation can use the simple statement return endOfData();
      • hasNext

        public final boolean hasNext()
      • tryToComputeNext

        private boolean tryToComputeNext()
      • next

        public final A next()