|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.data.AbleLiteral | +--com.ibm.able.data.AbleCallLiteral
This class performs a method invocation to a specific method on an object in an Able ruleset. The constructor uses introspection to try to find a constructor method on the target class that matches the specified argument types. This literal behaves somewhat differently from other AbleLiterals, in that is not strictly a constant, it invokes the same method on the same typed variable, but the underlying Object being invoked may change during the course of a ruleset evaluation.
Field Summary | |
---|---|
protected java.util.Vector |
myArgs
A list of arguments to the user-defined function named by myCallee. |
protected int |
myArity
The number of arguments to the user-defined function named by myCallee. |
protected java.lang.String |
myCallee
The name of the user-defined function (method) owned by myUdfMgr to call when the current value of this literal is requested. |
protected java.lang.Object |
myUdfMgr
An object that implements the AbleUserDefinedFunctionManager interface. |
protected java.lang.Object |
myValue
The current value of this literal. |
Constructor Summary | |
---|---|
AbleCallLiteral(AbleCallLiteral theCallLiteral,
java.util.Vector theArgs)
Create a copy of this call literal with replacement args |
|
AbleCallLiteral(java.lang.Object theUdfMgr,
java.lang.String theCallee,
java.util.Vector theArgs)
Create a new Able data call object with the specified information. |
|
AbleCallLiteral(java.lang.String theCallee,
java.util.Vector theArgs)
Create a new Able data method object with the specified information. |
Method Summary | |
---|---|
java.lang.String |
arlCRdString()
Return a formal ARL "clause read" string that describes this data object. |
boolean |
cmpEq(AbleRd theRhs)
Comparison, equal to: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpGt(AbleRd theRhs)
Comparison, greater than: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpGtEq(AbleRd theRhs)
Comparison, greater than or equal to: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpLt(AbleRd theRhs)
Comparison, less than: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpLtEq(AbleRd theRhs)
Comparison, less than or equal to: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpNeq(AbleRd theRhs)
Comparison, not equal to: compare the current value of this data object to the current value of theRhs. |
AbleLiteral |
compDivide(AbleRd theRhs)
Compute, divide the current value of this data object by the current value of theRhs. |
AbleLiteral |
compMinus(AbleRd theRhs)
Compute, subtract the current value of theRhs from the current value of this object. |
AbleLiteral |
compMultiply(AbleRd theRhs)
Compute, multiply the current value of this data object to the current value of theRhs. |
AbleLiteral |
compPlus(AbleRd theRhs)
Compute, add the current value of this data object to the current value of theRhs. |
AbleLiteral |
compUnaryMinus(AbleRd theRhs)
Compute, the unary minus of the current value of this object. |
protected java.lang.Object[] |
cvtArgs(java.util.Vector theArgs)
|
java.util.Vector |
getArgs()
|
int |
getArity()
|
boolean |
getBooleanValue()
Retrieve the value of this data object as a boolean value. |
java.lang.String |
getCallee()
|
java.lang.String |
getCalleeWithArgs()
|
java.lang.String |
getCalleeWithArity()
|
int |
getDataType()
Retrieve the data type of this data object. |
java.lang.Class |
getDataTypeClass()
Retrieve the actual class of this object's underlying data type. |
java.lang.String |
getDataTypeClassName()
Retrieve the name of the class of this object's underlying data type. |
AbleFuzzySet |
getFuzzyValue()
Retrieve the value of this data object as a fuzzy value. |
java.lang.Object |
getGenericValue()
Retrieve the value of this data object as an Object. |
double |
getNumericValue()
Retrieve the value of this data object as a numeric value. |
java.lang.Object |
getRawValue()
|
java.util.BitSet |
getReferents()
Retrieve the Ids of the variables to which this data object refers, if any. |
java.lang.Class |
getReturnType()
Get the data type of the value returned from the associated method invocation. |
java.lang.String |
getStringValue()
Retrieve the value of this data object as a string value. |
java.lang.String |
getTemplateString(java.util.Vector theTemplateVars)
Retrieve a text format string for use by rule templates. |
AbleLiteral |
getValue()
Retrieve the value of this data object as a literal. |
java.util.HashSet |
getVariableReferences()
Retrieve the set of variables (if any) referenced by this expression (and subexpressions) |
boolean |
isConstant()
Returns true if this AbleRd object is a constant value false, if it does not. |
boolean |
logicalAND(AbleRd theRhs)
Logical AND the current value of this data object with the current value of theRhs. |
boolean |
logicalNOT(AbleRd theRhs)
Logical NOT: complement the current value of this data object. |
boolean |
logicalOR(AbleRd theRhs)
Logical OR the current value of this data object with the current value of theRhs. |
protected void |
performCall()
|
java.lang.String |
traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object. |
protected java.lang.String |
trcString(int theTraceStringFlavor)
|
java.lang.String |
xmlCRdString()
Return a formal XML "clause read" string that describes this data object. |
Methods inherited from class com.ibm.able.data.AbleLiteral |
---|
bitwiseAND, bitwiseNOT, bitwiseOR, bitwiseShiftLeft, bitwiseShiftRight, bitwiseShiftRightZeroFill, bitwiseXOR, cmpIs, compModulo, Copyright, getDataTypeAsString, getReferent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient java.lang.Object myValue
protected java.lang.Object myUdfMgr
protected java.lang.String myCallee
protected java.util.Vector myArgs
protected int myArity
Constructor Detail |
public AbleCallLiteral(java.lang.Object theUdfMgr, java.lang.String theCallee, java.util.Vector theArgs)
theUdfMgr
- A reference to an object that implements either the
AbleUserDefinedFunctionManager interface.
theCallee
- The name of the user-defined function to call.
theArgs
- A list of AbleRd objects whose runtime values will be
passed to the user-defined function as arguments. Each
converted argument will be a Boolean, a Double, a
String, or an Object, depending on the type of each
AbleRd object in the argument list. The list can be
empty, but it must never be null.
public AbleCallLiteral(AbleCallLiteral theCallLiteral, java.util.Vector theArgs)
public AbleCallLiteral(java.lang.String theCallee, java.util.Vector theArgs)
theDataType
- An AbleData.<DataType> constant.
theCallee
- The name of the method to call.
theArgs
- A list of AbleRd objects whose runtime values will be
passed to the user-defined function as arguments. Each
converted argument will be a Boolean, a Double, a
String, or an Object, depending on the type of each
AbleRd object in the argument list. The list can be
empty, but it must never be null.
Method Detail |
public boolean getBooleanValue() throws AbleDataException
getBooleanValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
a boolean value.public AbleFuzzySet getFuzzyValue() throws AbleDataException
getFuzzyValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
a fuzzy value.public java.lang.Object getGenericValue() throws AbleDataException
getGenericValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
an Object.public double getNumericValue() throws AbleDataException
getNumericValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
a numeric value.public java.lang.String getStringValue() throws AbleDataException
getStringValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
a string value.public AbleLiteral getValue() throws AbleDataException
The user-defined function is called, which must return either a Boolean, Number derivative, String, or Object object, which will be turned into an AbleLiteral and returned.
It is OK for a user-defined function to return null. It will be turned into an AbleGenericLiteral whose value is null.
If the user-defined function returns some other object than those listed above, an exception is thrown.
getValue
in class AbleLiteral
AbleDataException
- If the value of this object cannot be represented as
an Able data literal.public java.lang.Class getDataTypeClass()
AbleLiteral
getDataTypeClass
in class AbleLiteral
com.ibm.able.data.AbleLiteral
public java.lang.String getDataTypeClassName()
AbleLiteral
getDataTypeClassName
in class AbleLiteral
com.ibm.able.data.AbleLiteral
public java.lang.String arlCRdString()
arlCRdString
in class AbleLiteral
public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
getTemplateString
in class AbleLiteral
theTemplateVars
- An ordered list of template variables referenced by this rule.public java.lang.String xmlCRdString()
xmlCRdString
in class AbleLiteral
public boolean cmpEq(AbleRd theRhs) throws AbleDataException
"==" is used for numeric and boolean compares; equals() is used for Object compares; and Collator.equals() is used for String compares.
cmpEq
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean cmpGt(AbleRd theRhs) throws AbleDataException
">" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.
cmpGt
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean cmpGtEq(AbleRd theRhs) throws AbleDataException
">=" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.
cmpGtEq
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean cmpLt(AbleRd theRhs) throws AbleDataException
"<" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.
cmpLt
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean cmpLtEq(AbleRd theRhs) throws AbleDataException
"<=" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.
cmpLtEq
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean cmpNeq(AbleRd theRhs) throws AbleDataException
"!=" is used for numeric and boolean compares; ! equals() is used for Object compares; and ! Collator.equals() is used for String compares.
cmpNeq
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public AbleLiteral compPlus(AbleRd theRhs) throws AbleDataException
"+" is used for numeric addtion and String concatenation.
compPlus
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public AbleLiteral compMinus(AbleRd theRhs) throws AbleDataException
"-" is used for numeric subtraction.
compMinus
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public AbleLiteral compMultiply(AbleRd theRhs) throws AbleDataException
"*" is used for numeric multiplication.
compMultiply
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public AbleLiteral compDivide(AbleRd theRhs) throws AbleDataException
"/" is used for numeric division.
compDivide
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public AbleLiteral compUnaryMinus(AbleRd theRhs) throws AbleDataException
"-" is used for numeric negation.
compUnaryMinus
in class AbleLiteral
theRhs
- The right-hand side of the operation (ignored).
AbleDataException
- If the value of this data object cannot be negated.public boolean logicalAND(AbleRd theRhs) throws AbleDataException
"&&" is used for boolean AND.
logicalAND
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean logicalOR(AbleRd theRhs) throws AbleDataException
"||" is used for boolean OR.
logicalOR
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean logicalNOT(AbleRd theRhs) throws AbleDataException
"!" is used for boolean NOT.
logicalNOT
in class AbleLiteral
theRhs
- The right-hand side of the comparison.
AbleDataException
- If the right-hand side cannot be converted (if
necessary) and compared to this data object.public boolean isConstant()
AbleRd
isConstant
in class AbleLiteral
public java.lang.Object getRawValue()
public java.lang.String getCallee()
public java.lang.String getCalleeWithArity()
public java.lang.String getCalleeWithArgs() throws AbleDataException
public java.util.Vector getArgs()
public int getArity()
protected void performCall() throws AbleDataException
protected java.lang.Object[] cvtArgs(java.util.Vector theArgs) throws AbleDataException
public java.lang.Class getReturnType() throws java.rmi.RemoteException
public java.util.BitSet getReferents()
getReferents
in class AbleLiteral
public java.lang.String traceString(int theTraceStringFlavor)
traceString
in class AbleLiteral
theFlavor
- An Able.TraceStringFlavor value.
protected java.lang.String trcString(int theTraceStringFlavor)
public int getDataType()
AbleLiteral
getDataType
in class AbleLiteral
AbleRd.getDataType()
public java.util.HashSet getVariableReferences()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |