edu.stanford.nlp.util.AbstractIterator Maven / Gradle / Ivy
package edu.stanford.nlp.util;
import java.util.Iterator;
/**
* Iterator with remove()
defined to throw an
* UnsupportedOperationException
.
*/
public abstract class AbstractIterator implements Iterator {
/** {@inheritDoc} */
@Override
public abstract boolean hasNext();
/** {@inheritDoc} */
@SuppressWarnings("IteratorNextCanNotThrowNoSuchElementException")
@Override
public abstract E next();
/**
* Throws an UnsupportedOperationException
.
*/
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}