com.mysema.commons.lang
Class IteratorAdapter<T>

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

public class IteratorAdapter<T>
extends Object
implements CloseableIterator<T>

Adapter implementation for Iterator and CloseableIterator instances

Author:
sasa

Constructor Summary
IteratorAdapter(Iterator<T> iter)
           
IteratorAdapter(Iterator<T> iter, Closeable closeable)
           
 
Method Summary
 List<T> asList()
           
static
<T> List<T>
asList(Iterator<T> iter)
           
 void close()
          Closes this iterator and releases any system resources associated with it.
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorAdapter

public IteratorAdapter(Iterator<T> iter)

IteratorAdapter

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

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 CloseableIterator<T>
Specified by:
close in interface Closeable

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>


Copyright © 2008-2012 Mysema Ltd. All Rights Reserved.