com.annimon.stream.LsaIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stream Show documentation
Show all versions of stream Show documentation
Stream API from Java 8 rewritten on iterators for Java 7 and below
package com.annimon.stream;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Abstract iterator with implemented {@code remove} method.
*/
abstract class LsaIterator implements Iterator {
@Override
public void remove() {
throw new UnsupportedOperationException("remove not supported");
}
@Override
public final T next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
return nextIteration();
}
public abstract T nextIteration();
}