|
|||||||||
| 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.FindSequence<T>
public class FindSequence<T>
Locates a sequence that matches the given pattern.
To Serialize a FindSequence, the generic parameter T must be serializable.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
FindSequence.Visitor
Interface for classes that may interpret a FindSequence functor |
| Constructor Summary | |
|---|---|
FindSequence(java.util.Collection<? extends T> pattern)
Builds a FindSequence functor that locates the given pattern using the equals() method to compare elements. |
|
FindSequence(java.util.Collection<? extends T> pattern,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Builds a FindSequence functor that locates the given pattern using given functor to compare elements. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(FindSequence) method, if it
implements the nested Visitor interface. |
LookAheadIterator<T> |
fn(java.util.Iterator<? extends T> iterator)
Locates a sequence that matches the given pattern. |
BinaryFunctor<T,T,java.lang.Boolean> |
getComparisonFn()
Returns the functor used to compare elements in the iteration and the pattern. |
java.util.Collection<? extends T> |
getPattern()
Returns the pattern 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 FindSequence(java.util.Collection<? extends T> pattern)
public FindSequence(java.util.Collection<? extends T> pattern,
BinaryFunctor<T,T,java.lang.Boolean> eq)
java.lang.IllegalArgumentException - if the functor is null.| Method Detail |
|---|
public java.util.Collection<? extends T> getPattern()
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(FindSequence) 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 | ||||||||