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

net.lenni0451.commons.collections.iterators.DelegateIterator Maven / Gradle / Ivy

The newest version!
package net.lenni0451.commons.collections.iterators;

import java.util.Iterator;

/**
 * An iterator which delegates all calls to the given iterator.
 *
 * @param  The type of the elements in this iterator
 */
public class DelegateIterator implements Iterator {

    private final Iterator delegate;

    public DelegateIterator(final Iterator delegate) {
        this.delegate = delegate;
    }

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

    @Override
    public E next() {
        return this.delegate.next();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy