| java.lang.Object net.sf.jga.algorithms.Unique net.sf.jga.util.UniqueIterable
UniqueIterable | public class UniqueIterable extends Unique.UniqueIterable (Code) | | Produces iterators that will not return the same element twice in succession.
Copyright © 2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | UniqueIterable(Iterable<? extends T> base) Builds a UniqueIterable for the given base iterator. | public | UniqueIterable(Iterable<? extends T> base, BinaryFunctor<T, T, Boolean> pred) Builds a UniqueIterable for the given base iterator that uses the given
predicate to compare successive elements. |
UniqueIterable | public UniqueIterable(Iterable<? extends T> base)(Code) | | Builds a UniqueIterable for the given base iterator. It will use an EqualTo
predicate by default.
throws: IllegalArgumentException - if either argument is null |
UniqueIterable | public UniqueIterable(Iterable<? extends T> base, BinaryFunctor<T, T, Boolean> pred)(Code) | | Builds a UniqueIterable for the given base iterator that uses the given
predicate to compare successive elements. The predicate should return
TRUE if its first argument is equal to the second.
throws: IllegalArgumentException - if the base iterable is null |
Methods inherited from net.sf.jga.algorithms.Unique | public static Iterable<T> unique(T[] ts)(Code)(Java Doc) public static Iterable<T> unique(T[] ts, Comparator<? super T> comp)(Code)(Java Doc) public static Iterable<T> unique(T[] ts, BinaryFunctor<T, T, Boolean> eq)(Code)(Java Doc) public static Iterable<T> unique(Iterable<? extends T> i)(Code)(Java Doc) public static Iterable<T> unique(Iterable<? extends T> i, Comparator<? super T> comp)(Code)(Java Doc) public static Iterable<T> unique(Iterable<? extends T> i, BinaryFunctor<T, T, Boolean> eq)(Code)(Java Doc) public static Iterator<T> unique(Iterator<? extends T> iterator)(Code)(Java Doc) public static Iterator<T> unique(Iterator<? extends T> iterator, Comparator<? super T> comp)(Code)(Java Doc) public static Iterator<T> unique(Iterator<? extends T> iterator, BinaryFunctor<T, T, Boolean> eq)(Code)(Java Doc) public static TCollection unique(Iterable<? extends T> lin, TCollection cout)(Code)(Java Doc) public static TCollection unique(Iterable<? extends T> lin, Comparator<? super T> comp, TCollection cout)(Code)(Java Doc) public static TCollection unique(Iterable<? extends T> lin, BinaryFunctor<T, T, Boolean> eq, TCollection cout)(Code)(Java Doc)
|
|
|