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

functionalj.stream.doublestream.StreamBackedDoubleIteratorPlus Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
package functionalj.stream.doublestream;

import java.util.PrimitiveIterator;
import java.util.stream.DoubleStream;

public class StreamBackedDoubleIteratorPlus implements DoubleIteratorPlus {
    
    private final DoubleStream stream;
    private final PrimitiveIterator.OfDouble iterator;
    
    public StreamBackedDoubleIteratorPlus(DoubleStream stream) {
        this.stream = stream;
        this.iterator = stream.iterator();
    }
    
    @Override
    public PrimitiveIterator.OfDouble asIterator() {
        return iterator;
    }
    
    public void close() {
        stream.close();
    }
    
    public DoubleIteratorPlus onClose(Runnable closeHandler) {
        this.stream.onClose(closeHandler);
        return this;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy