Class IteratorAdapter<T>

java.lang.Object
com.mysema.commons.lang.IteratorAdapter<T>
All Implemented Interfaces:
CloseableIterator<T>, Closeable, AutoCloseable, Iterator<T>

public class IteratorAdapter<T> extends Object implements CloseableIterator<T>
Adapter implementation for Iterator and CloseableIterator instances
  • Field Details

  • Constructor Details

    • IteratorAdapter

      public IteratorAdapter(Iterator<T> iter)
    • IteratorAdapter

      public IteratorAdapter(Iterator<T> iter, Closeable closeable)
  • Method Details

    • asList

      public static <T> List<T> asList(Iterator<T> iter)
    • asList

      public List<T> asList()
    • close

      public void close()
      Description copied from interface: CloseableIterator
      Closes this iterator and releases any system resources associated with it. If the iterator is already closed then invoking this method has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface CloseableIterator<T>
    • 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>