com.ibm.websphere.brb.implementor
Class RuleConvert

java.lang.Object
  extended bycom.ibm.websphere.brb.implementor.RuleConvert
All Implemented Interfaces:
RuleImplementor

public class RuleConvert
extends java.lang.Object
implements RuleImplementor

Derivation rule used to compute and return the result from a generic conversion performed with the formula mx+b. M is the multiplier, b is the delta, and x is the number to be converted.


Constructor Summary
RuleConvert()
          Parameterless constructor for RuleConver.
 
Method Summary
 java.lang.Object fire(TriggerPoint tp, java.lang.Object target, IRuleCopy rule, java.lang.Object[] parms)
          Returns the computation resulting from mx + b where x is the thing to be converted, m is the multiplier and b is the delta.
 java.lang.String getDescription()
          The programmer's description of what the algorithm does.
 void init(java.lang.Object[] parms, java.lang.String[] dependentRules, java.lang.String userDefinedData, IRuleCopy rule)
          Initializes constants used by this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleConvert

public RuleConvert()
Parameterless constructor for RuleConver.

Method Detail

fire

public java.lang.Object fire(TriggerPoint tp,
                             java.lang.Object target,
                             IRuleCopy rule,
                             java.lang.Object[] parms)
                      throws BusinessRuleBeansException
Returns the computation resulting from mx + b where x is the thing to be converted, m is the multiplier and b is the delta. m and b could have been provided as initialization parameters[0] and [1], respectively. Otherwise they are provided as firing parameter[1]and firing parameter[2]. x is always received as firing parameter[0].

Specified by:
fire in interface RuleImplementor
Parameters:
tp - the trigger point which is firing this rule implementor.
target - the target object of the trigger point
rule - the rule that the implementor is running on behalf of
Returns:
The result of firing the rule implementor. Implementors that carry out classifications must return a single String. Implementors which check constraints should generally return a ConstraintReturn, especially if the results are to be combined and returned by the BRBeans framework.
Throws:
BusinessRuleBeansException

getDescription

public java.lang.String getDescription()
The programmer's description of what the algorithm does.

Specified by:
getDescription in interface RuleImplementor
Returns:
A description of this rule implementor.

init

public void init(java.lang.Object[] parms,
                 java.lang.String[] dependentRules,
                 java.lang.String userDefinedData,
                 IRuleCopy rule)
          throws BusinessRuleBeansException
Initializes constants used by this rule. Two initialization parameters can be passed: the multiplier and the delta, in that order. If no initialization parameters are supplied, these constants can be passed as firing parameters.

Specified by:
init in interface RuleImplementor
Parameters:
parms - the parameters needed to initialize this RuleImplementor
dependentRules - the names of the dependent rules to this rule; if there are none, null is passed
userDefinedData - userDefinedData property from the Rule
rule - the Rule on whose behalf the rule implementor is running
Throws:
BusinessRuleBeansException