net.sf.jga.fn.string

Class Match

public class Match extends AbstractUnaryPredicate<String> implements Serializable

Unary Functor that tests a string argument against a given regular expression.

Copyright © 2003 David A. Hall

Author: David A. Hall

Nested Class Summary
interfaceMatch.Visitor
Interface for classes that may interpret a Match predicate.
Constructor Summary
Match()
Match(String regex)
Method Summary
voidaccept(Visitor v)
Calls the Visitor's visit(Match) method, if it implements the nested Visitor interface.
StringgetRegex()
Returns the format object used to present values in formatted form.
booleanp(String arg)
Tests a string against the regular expression given at construction

StringtoString()

Constructor Detail

Match

public Match()

Match

public Match(String regex)

Method Detail

accept

public void accept(Visitor v)
Calls the Visitor's visit(Match) method, if it implements the nested Visitor interface.

getRegex

public String getRegex()
Returns the format object used to present values in formatted form.

Returns: the format used to present values

p

public boolean p(String arg)
Tests a string against the regular expression given at construction

Parameters: arg the value to tested

Returns: true if the string matches the regular expression given at construction

toString

public String toString()