Class BoundedIteratorReadable<O>

  • Type Parameters:
    O - output type.
    All Implemented Interfaces:
    java.io.Serializable, Readable<O>

    public abstract class BoundedIteratorReadable<O>
    extends java.lang.Object
    implements Readable<O>
    An abstract readable class that retrieves data from iterator.
    See Also:
    Serialized Form
    • Constructor Detail

      • BoundedIteratorReadable

        public BoundedIteratorReadable()
    • Method Detail

      • initializeIterator

        protected abstract java.util.Iterator<O> initializeIterator()
        Initialize iterator.
        Returns:
        iterator
      • prepare

        public final void prepare()
        Prepare reading data.
        Specified by:
        prepare in interface Readable<O>
      • readCurrent

        public final O readCurrent()
        Description copied from interface: Readable
        Method to read current data from the source. The caller should check whether the Readable is finished or not by using isFinished() method before calling this method.
        Specified by:
        readCurrent in interface Readable<O>
        Returns:
        a data read by the readable.
      • isFinished

        public final boolean isFinished()
        Specified by:
        isFinished in interface Readable<O>
        Returns:
        true if it reads all data.