All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.archive.util.iterator.CloseableIteratorWrapper Maven / Gradle / Ivy

There is a newer version: 1.1.9
Show newest version
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
    }		
}