public class Operator
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CNAME |
Constructor and Description |
---|
Operator(java.lang.String name,
java.lang.Object[] operandList)
Constructs an operator object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Tests two Operator objects for equality
|
java.lang.Object |
evaluate()
Evaluates the operator and returns the results.
|
java.lang.String |
getDisplayName()
Retrieves the operator display name
|
java.lang.String |
getName()
Retrieves the operator name
|
java.lang.Object[] |
getOperands()
Retrieves the operands
|
static OperatorDescriptor[] |
getOperatorDescriptors()
Describes all available operators.
|
java.lang.String |
getType()
Retrieves the return type of the operator.
|
void |
setRuleDataContext(RuleDataContext rdc)
Sets the RuleDataContext.
|
java.lang.String |
toString()
Returns the string representation of this Operator
|
public Operator(java.lang.String name, java.lang.Object[] operandList)
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.
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.java.lang.IllegalArgumentException
- if the named operator
is not supportedjava.lang.IllegalArgumentException
- if the operands in operandList do not
match the descriptor of the named operatorjava.lang.IllegalArgumentException
- if the name is nulljava.lang.IllegalArgumentException
- if the operandList array contains null elementspublic static OperatorDescriptor[] getOperatorDescriptors() throws OperatorException
Use this static method to identify all available operators and their required operands before constructing an instance of this class.
OperatorException
public java.lang.String getName()
public java.lang.String getDisplayName()
public java.lang.Object[] getOperands()
public java.lang.String getType()
public java.lang.Object evaluate() throws OperatorException
OperatorException
- if a problem is encountered
durring evaluationpublic void setRuleDataContext(RuleDataContext rdc)
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.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000-2024 Cloud Software Group, Inc. All Rights Reserved.