Class Operator
java.lang.Object
COM.TIBCO.hawk.config.rbengine.rulebase.Operator
- All Implemented Interfaces:
Serializable
This class is used to build all operators for use as
test expressions in Test objects.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests two Operator objects for equalityevaluate()Evaluates the operator and returns the results.Retrieves the operator display namegetName()Retrieves the operator nameObject[]Retrieves the operandsstatic OperatorDescriptor[]Describes all available operators.getType()Retrieves the return type of the operator.voidSets the RuleDataContext.toString()Returns the string representation of this Operator
-
Field Details
-
CNAME
-
-
Constructor Details
-
Operator
Constructs an operator object.The supplied operands are checked against the corresponding operator descriptor for validity. This insures that the correct number and types of operands are used.
If an Operator object is supplied as one of the operands, its advertised type is used in the type checking. If its advertised type is java.lang.Object, then it is accepted here and type checking of the result is performed at runtime.
- Parameters:
name- The name of the operator being constructed. Cannot be null.operandList- The operands of the operator. May be null or empty array to indicate no operads.- Throws:
IllegalArgumentException- if the named operator is not supportedIllegalArgumentException- if the operands in operandList do not match the descriptor of the named operatorIllegalArgumentException- if the name is nullIllegalArgumentException- if the operandList array contains null elements
-
-
Method Details
-
getOperatorDescriptors
Describes all available operators.Use this static method to identify all available operators and their required operands before constructing an instance of this class.
- Throws:
OperatorException
-
getName
Retrieves the operator name -
getDisplayName
Retrieves the operator display name -
getOperands
Retrieves the operands -
getType
Retrieves the return type of the operator.- Returns:
- the class name of the type returned by the evaluate() method
-
evaluate
Evaluates the operator and returns the results. If evaluation occurs successfully, the result is gauranteed to be of the type advertised by the getType() method.- Throws:
OperatorException- if a problem is encountered durring evaluation
-
setRuleDataContext
Sets the RuleDataContext. This method is intended for use by the rules engine which evaluates this operator. The RuleDataContext allows the operators to access the rule engine's data.When invoked on an instance of this class, this method will be recursively applied to any oprands that also happen to be instances of this class.
-
equals
Tests two Operator objects for equality -
toString
Returns the string representation of this Operator
-