wt.rule.algorithm
Class CaseBranch

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

public final class CaseBranch
extends Object
implements RuleAlgorithm

This is a branch algorithm, which is similar to BooleanBranch, but allows any odd number of parts as input and allows a default return. What if the length passed in is not an odd number, throw exception immediately, since there isn't a default return for the "case".If the odd number parameters passed is not a Boolean, throw exception.The exception message contains which case failed to indicate the problem when happened.

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