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

functionalj.stream.longstream.StreamBackedLongIteratorPlus Maven / Gradle / Ivy

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

import java.util.PrimitiveIterator;
import java.util.stream.LongStream;

public class StreamBackedLongIteratorPlus implements LongIteratorPlus {
    
    private final LongStream stream;
    private final PrimitiveIterator.OfLong iterator;
    
    public StreamBackedLongIteratorPlus(LongStream stream) {
        this.stream = stream;
        this.iterator = stream.iterator();
    }
    
    @Override
    public PrimitiveIterator.OfLong asIterator() {
        return iterator;
    }
    
    public void close() {
        stream.close();
    }
    
    public LongIteratorPlus onClose(Runnable closeHandler) {
        this.stream.onClose(closeHandler);
        return this;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy