| net.sf.jga.fn.algorithm.FindRepeated
FindRepeated | public class FindRepeated extends LookAheadFunctor (Code) | | Locates runs of repeated values in an iteration.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | FindRepeated(int count, T value) Builds a FindRepeated functor that will look for a run of the given size,
using the equals() method. | public | 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. | public | FindRepeated(int count, UnaryFunctor<T, Boolean> eq) Builds a FindRepeated functor that will look for a run of the given size,
using the given functor. |
serialVersionUID | final static long serialVersionUID(Code) | | |
FindRepeated | public FindRepeated(int count, T value)(Code) | | Builds a FindRepeated functor that will look for a run of the given size,
using the equals() method.
|
FindRepeated | public FindRepeated(int count, T value, Equality<T> eq)(Code) | | Builds a FindRepeated functor that will look for a run of the given size,
using the given equality functor.
|
FindRepeated | public FindRepeated(int count, UnaryFunctor<T, Boolean> eq)(Code) | | Builds a FindRepeated functor that will look for a run of the given size,
using the given functor. The functor is expected to return TRUE if the
element should be included in the run.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(FindRepeated) method, if it
implements the nested Visitor interface.
|
fn | public LookAheadIterator<T> fn(Iterator<? extends T> iterator)(Code) | | Locates the first/next run of the given length containing elements that
meet the given criteria.
an Iterator whose next() [if it hasNext()] points at the firstelement in the desired run. If no such run of elements exists, then thereturned iterator's hasNext() will be false. |
getComparisonFn | public UnaryFunctor<T, Boolean> getComparisonFn()(Code) | | Returns the functor used to determine if the element should be included
in the run
|
getRunLength | public int getRunLength()(Code) | | Returns the length of the run being sought
|
|
|