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

groovy.stream.iterators.EmptyIterator Maven / Gradle / Ivy

Go to download

A collection of classes to give a fluent builder for Streams (Lazy Groovy Generators).

The newest version!
package groovy.stream.iterators;

import java.util.Iterator;
import java.util.NoSuchElementException;

public class EmptyIterator implements Iterator {
    @Override
    public boolean hasNext() {
        return false;
    }

    @Override
    public T next() {
        throw new NoSuchElementException( "EmptyIterator contains no elements" ) ;
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException( "Remove not supported on EmptyIterator" ) ;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy