net.sf.jga.util
public class UniqueIterator<T> extends Object implements Iterator<T>
Copyright © 2003 David A. Hall
Constructor Summary | |
---|---|
UniqueIterator(Iterator<? extends T> base)
Builds a UniqueIterator for the given base iterator. | |
UniqueIterator(Iterator<? extends T> base, BinaryFunctor<T,T,Boolean> eq)
Builds a UniqueIterator for the given base iterator that uses the given
predicate to compare adjacent elements. |
Method Summary | |
---|---|
boolean | hasNext() |
T | next() |
void | remove() |
static <T> UniqueIterator<T> | wrapIfNecessary(Iterator<? extends T> base)
Creates a UniqueIterator to wrap the given iterator, if the given iterator
isn't already a UniqueIterator |
Throws: IllegalArgumentException if either argument is null
Returns:
Returns: