|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jga.fn.UnaryFunctor<java.util.Iterator<? extends T>,UniqueIterator<T>>
net.sf.jga.fn.algorithm.Unique<T>
public class Unique<T>
Returns an iterator based on the input iterator that will not yield the same value twice in succession.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
Unique.Visitor
Interface for classes that may interpret an Unique functor. |
| Constructor Summary | |
|---|---|
Unique()
Builds an Unique functor that will use EqualTo to compare successive elements. |
|
Unique(BinaryFunctor<T,T,java.lang.Boolean> test)
Builds an Unique functor that will use the given functor to compare successive elements. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Unique) method, if it
implements the nested Visitor interface. |
UniqueIterator<T> |
fn(java.util.Iterator<? extends T> iterator)
Apply the functor to each element in the iteration and return an iterator over the results |
BinaryFunctor<T,T,java.lang.Boolean> |
getFunction()
Returns the functor used to process elements in an iteration. |
java.lang.String |
toString()
|
| Methods inherited from class net.sf.jga.fn.UnaryFunctor |
|---|
bind, compose, compose, generate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Unique()
java.lang.IllegalArgumentException - if the test is nullpublic Unique(BinaryFunctor<T,T,java.lang.Boolean> test)
java.lang.IllegalArgumentException - if the test is null| Method Detail |
|---|
public BinaryFunctor<T,T,java.lang.Boolean> getFunction()
public UniqueIterator<T> fn(java.util.Iterator<? extends T> iterator)
fn in class UnaryFunctor<java.util.Iterator<? extends T>,UniqueIterator<T>>public void accept(Visitor v)
visit(Unique) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class UnaryFunctor<java.util.Iterator<? extends T>,UniqueIterator<T>>public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||