|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.fn.Functor<R> net.sf.jga.fn.UnaryFunctor<java.lang.String,java.lang.Boolean> net.sf.jga.fn.string.Match
public class Match
Unary Functor that tests a string argument against a given regular expression. The expression is not presumed to be anchored: if any part of the input string matches the regular expression, then the result will be true.
Copyright © 2003-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
Match.Visitor
Interface for classes that may interpret a Match predicate. |
Constructor Summary | |
---|---|
Match()
Builds a Match with an empty string pattern |
|
Match(java.util.regex.Pattern pattern)
Builds a Match with a given Pattern |
|
Match(java.lang.String regex)
Builds a Match with a given regular expression |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Match) method, if it
implements the nested Visitor interface. |
java.lang.Boolean |
fn(java.lang.String arg)
Tests a string against the regular expression given at construction |
java.lang.String |
getRegex()
Returns the format object used to present values in formatted form. |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.UnaryFunctor |
---|
bind, bind0th, bindNth, compose, compose, compose, composeNth, composeNth, eval, generate, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Match()
public Match(java.lang.String regex)
public Match(java.util.regex.Pattern pattern)
Method Detail |
---|
public java.lang.String getRegex()
public java.lang.Boolean fn(java.lang.String arg)
fn
in class UnaryFunctor<java.lang.String,java.lang.Boolean>
arg
- the value to tested
public void accept(Visitor v)
visit(Match)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<java.lang.Boolean>
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 |