wt.rule.algorithm
Class BooleanBranch

java.lang.Object
  extended bywt.rule.algorithm.BooleanBranch
All Implemented Interfaces:
RuleAlgorithm

public class BooleanBranch
extends Object
implements RuleAlgorithm

This algorithm returns one of two values based on a boolean value. The algorithm takes three arguments:

  1. boolean value
  2. value to return if first argument is true
  3. value to return if first argumetn is false


Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
private static boolean VERBOSE
           
private static String VERBOSE_PROPERTY_NAME
           
 
Constructor Summary
BooleanBranch()
           
 
Method Summary
 Object calculate(Object[] args, WTContainerRef container)
          Execute the algorithm using the specified arguments.
 void validateArgs(String[] args)
          Validate the arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

VERBOSE

private static final boolean VERBOSE

VERBOSE_PROPERTY_NAME

private static final String VERBOSE_PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

BooleanBranch

public BooleanBranch()
Method Detail

calculate

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

Supported API: false

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

validateArgs

public void validateArgs(String[] args)
                  throws InvalidAlgorithmArgumentException
Validate the arguments. Throw an InvalidAlgorithmArgumentException if any of the arguments are invalid.

Supported API: false

Specified by:
validateArgs in interface RuleAlgorithm
Parameters:
args - the string args from the XML
Throws:
InvalidAlgorithmArgumentException