Class SerializableIterator<T>

java.lang.Object
org.refcodes.io.SerializableIterator<T>
Type Parameters:
T - The type of the instances managed by the Iterator.
All Implemented Interfaces:
Serializable, Iterator<T>

public class SerializableIterator<T> extends Object implements Iterator<T>, Serializable
Makes the wrapped Iterator serializable, else passing Iterator instances would cause an NotSerializableException or similar.
See Also:
  • Constructor Details

    • SerializableIterator

      public SerializableIterator()
      Instantiates a new serializable iterator impl.
    • SerializableIterator

      public SerializableIterator(Iterator<T> aIterator)
      Instantiates a new serializable iterator impl.
      Parameters:
      aIterator - the iterator
  • Method Details

    • hasNext

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

      public T next()
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>