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

functionalj.stream.intstream.StreamBackedIntIteratorPlus Maven / Gradle / Ivy

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

import java.util.PrimitiveIterator;
import java.util.stream.IntStream;

public class StreamBackedIntIteratorPlus implements IntIteratorPlus {
    
    private final IntStream stream;
    private final PrimitiveIterator.OfInt iterator;
    
    public StreamBackedIntIteratorPlus(IntStream stream) {
        this.stream = stream;
        this.iterator = stream.iterator();
    }
    
    @Override
    public PrimitiveIterator.OfInt asIterator() {
        return iterator;
    }
    
    public void close() {
        stream.close();
    }
    
    public IntIteratorPlus onClose(Runnable closeHandler) {
        this.stream.onClose(closeHandler);
        return this;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy