|
|||||||||
| 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>,LookAheadIterator<T>>
net.sf.jga.fn.algorithm.LookAheadFunctor<T>
net.sf.jga.fn.algorithm.FindAdjacent<T>
public class FindAdjacent<T>
Locates pairs of adjacent values in an iteration.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
FindAdjacent.Visitor
Interface for classes that may interpret an FindAdjacent functor. |
| Constructor Summary | |
|---|---|
FindAdjacent()
Builds a FindAdjacent functor that uses the equals() method to determine if adjacent values are the same. |
|
FindAdjacent(BinaryFunctor<T,T,java.lang.Boolean> eq)
Builds a FindAdjacent functor that uses the given predicate to determine if adjacent values are the same. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(FindAdjacent) method, if it
implements the nested Visitor interface. |
LookAheadIterator<T> |
fn(java.util.Iterator<? extends T> iterator)
Locates the first/next pair of adjacent elements in an iteration that are the same value. |
BinaryFunctor<T,T,java.lang.Boolean> |
getComparisonFn()
Returns the functor used to determine if two adjacent values are the same |
java.lang.String |
toString()
|
| Methods inherited from class net.sf.jga.fn.algorithm.LookAheadFunctor |
|---|
wrap |
| 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 FindAdjacent()
public FindAdjacent(BinaryFunctor<T,T,java.lang.Boolean> eq)
| Method Detail |
|---|
public BinaryFunctor<T,T,java.lang.Boolean> getComparisonFn()
public LookAheadIterator<T> fn(java.util.Iterator<? extends T> iterator)
fn in class UnaryFunctor<java.util.Iterator<? extends T>,LookAheadIterator<T>>public void accept(Visitor v)
visit(FindAdjacent) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class UnaryFunctor<java.util.Iterator<? extends T>,LookAheadIterator<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 | ||||||||