|
|||||||||
| 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.FindRepeated<T>
public class FindRepeated<T>
Locates runs of repeated values in an iteration.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
FindRepeated.Visitor
Interface for classes that may interpret an FindRepeated functor. |
| Constructor Summary | |
|---|---|
FindRepeated(int count,
T value)
Builds a FindRepeated functor that will look for a run of the given size, using the equals() method. |
|
FindRepeated(int count,
T value,
Equality<T> eq)
Builds a FindRepeated functor that will look for a run of the given size, using the given equality functor. |
|
FindRepeated(int count,
UnaryFunctor<T,java.lang.Boolean> eq)
Builds a FindRepeated functor that will look for a run of the given size, using the given functor. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(FindRepeated) method, if it
implements the nested Visitor interface. |
LookAheadIterator<T> |
fn(java.util.Iterator<? extends T> iterator)
Locates the first/next run of the given length containing elements that meet the given criteria. |
UnaryFunctor<T,java.lang.Boolean> |
getComparisonFn()
Returns the functor used to determine if the element should be included in the run |
int |
getRunLength()
Returns the length of the run being sought |
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 FindRepeated(int count,
T value)
public FindRepeated(int count,
T value,
Equality<T> eq)
public FindRepeated(int count,
UnaryFunctor<T,java.lang.Boolean> eq)
| Method Detail |
|---|
public int getRunLength()
public UnaryFunctor<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(FindRepeated) 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 | ||||||||