net.lenni0451.commons.collections.iterators.DelegateIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of main Show documentation
Show all versions of main Show documentation
A java library with many useful functions and classes
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();
}
}