org.archive.util.iterator.CloseableIteratorWrapper Maven / Gradle / Ivy
package org.archive.util.iterator;
import java.io.IOException;
import java.util.Iterator;
/**
* Wrap a regular Iterator to create a CloseableIterator where the close() is a no-op
* @author ilya
*
* @param
*/
public class CloseableIteratorWrapper implements CloseableIterator
{
protected Iterator iter;
public CloseableIteratorWrapper(Iterator iter)
{
this.iter = iter;
}
@Override
public boolean hasNext() {
return this.iter.hasNext();
}
@Override
public S next() {
return this.iter.next();
}
@Override
public void remove() {
this.iter.remove();
}
@Override
public void close() throws IOException {
//No Op
}
}