wt.rule.algorithm
Class StringRegExEqualsTest

java.lang.Object
  extended by wt.rule.algorithm.StringRegExEqualsTest
All Implemented Interfaces:
RuleAlgorithm

public final class StringRegExEqualsTest
extends Object
implements RuleAlgorithm

Given an attribute and a value, with "*" in the value, determine the equality using Regular Expression related concepts. The point here is to make available the java.util.regex implementation of regular expression matching. The return would be true if it finds a match and the match is the whole string argument. Force arg[0] using toString() first before comparison. If the length of the arguments passed is not two, throw exception.Force arg[0] using toString() first before comparison. If arg[1] passed is not String, throw exception. return Pattern.matches(arg[1], arg[0].toString()); OR: Pattern p=Pattern.compile(arg[1]); Matcher m=p.matcher(arg[0].toString()); Return m.matches(); true if, and only if, the entire input sequence matches this matcher's pattern

Supported API: true

Extendable: false


Method Summary
 Object calculate(Object[] args, WTContainerRef container)
          Execute the algorithm using the specified arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

calculate

public Object calculate(Object[] args,
                        WTContainerRef container)
                 throws WTException
Execute the algorithm using the specified arguments. Return the result.

Supported API: true

Specified by:
calculate in interface RuleAlgorithm
Parameters:
args - the arguments for the algorithm
container - the container to use for object lookups
Returns:
Object
Throws:
WTException