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

dev.marksman.collectionviews.ProtectedIterator Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
package dev.marksman.collectionviews;

import java.util.Iterator;

final class ProtectedIterator implements Iterator {
    private final Iterator underlying;

    private ProtectedIterator(Iterator underlying) {
        this.underlying = underlying;
    }

    @Override
    public boolean hasNext() {
        return underlying.hasNext();
    }

    @Override
    public A next() {
        return underlying.next();
    }

    static  ProtectedIterator protectedIterator(Iterator underlying) {
        return new ProtectedIterator<>(underlying);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy