| net.sf.jga.fn.algorithm.FindSequence
FindSequence | public class FindSequence extends LookAheadFunctor (Code) | | Locates a sequence that matches the given pattern.
To Serialize a FindSequence, the generic parameter T must be serializable.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | FindSequence(Collection<? extends T> pattern) Builds a FindSequence functor that locates the given pattern using the
equals() method to compare elements. | public | FindSequence(Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> eq) Builds a FindSequence functor that locates the given pattern using
given functor to compare elements. |
serialVersionUID | final static long serialVersionUID(Code) | | |
FindSequence | public FindSequence(Collection<? extends T> pattern)(Code) | | Builds a FindSequence functor that locates the given pattern using the
equals() method to compare elements.
|
FindSequence | public FindSequence(Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> eq)(Code) | | Builds a FindSequence functor that locates the given pattern using
given functor to compare elements. If the pattern is null, then an
arbitrary empty collection will be used.
throws: IllegalArgumentException - if the functor is null. |
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(FindSequence) method, if it
implements the nested Visitor interface.
|
fn | public LookAheadIterator<T> fn(Iterator<? extends T> iterator)(Code) | | Locates a sequence that matches the given pattern.
an iterator whose next() [if it hasNext()] points to thebeginning of a sequence in the iteration that matches the given pattern.If no such sequence exists, then the returned interator's hasNext() willbe false. |
getComparisonFn | public BinaryFunctor<T, T, Boolean> getComparisonFn()(Code) | | Returns the functor used to compare elements in the iteration and
the pattern.
|
getPattern | public Collection<? extends T> getPattern()(Code) | | Returns the pattern being sought
|
|
|