|
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.AbleExpression
An AbleExpression contains a unary or binary operator along with one or two AbleRd objects (which themselves could be AbleExpressions).
Field Summary | |
---|---|
static double |
DefaultWeight
A default weight. |
protected AbleRd |
myLhs
myLhs represents the left-hand side of this clause. |
protected int |
myOp
myOp is the unary or binary operator to be used to evaluate the left-hand side of this clause against the right-hand side of this clause. |
protected AbleRd |
myRhs
myRhs represents the right-hand side of this clause. |
protected AbleRd |
myValue
myValue represents the value of this expression when the left-hand side and the right-hand side values are computed and the operator is applied. |
protected double |
myWeight
myWeight represents the weight that this expression should be given when it is converted to an antecedent clause This field is initialized to DefaultWeight which means "unweighted". |
Constructor Summary | |
---|---|
AbleExpression(AbleDataContext theRuleSet,
java.lang.String theExprString)
Create a new expression from the String. |
|
AbleExpression(AbleRd theLhs,
int theOp,
AbleRd theRhs)
Create a new clause with the specified parts. |
Method Summary | |
---|---|
java.lang.String |
arlCRdString()
Return a formal ARL "clause read" string that describes this data object. |
java.util.Vector |
convertToConjunctiveNormalForm()
Convert this Expression into conjunctive normal form a list of ANDed AbleExpressions |
java.util.Vector |
convertToDisjunctiveNormalForm()
Convert this Expression into disjunctive normal form a list of ORed AbleExpressions |
AbleExpression |
createMatchExpression(java.util.Hashtable replacementVars)
Create a duplicate of this expression using replacement vars |
boolean |
equals(AbleExpression theExpr)
Determine whether this expression is equal to some other expression. |
boolean |
equals(java.lang.Object theExpr)
|
boolean |
getBooleanValue()
Retrieve the value of this data object as a boolean value. |
int |
getDataType()
Retrieve the data type of this data object. |
java.lang.Class |
getDataTypeClass()
Return expression value 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. |
AbleRd |
getLhs()
Retrieve the expression's left-hand side. |
double |
getNumericValue()
Retrieve the value of this data object as a numeric value. |
int |
getOp()
Retrieve the expression's operator. |
java.lang.String |
getOpAsString()
Retrieve the expression's operator in human-readable string form. |
java.util.BitSet |
getReferents()
Retrieve the Ids of the variables to which this data object refers, if any. |
AbleRd |
getRhs()
Retrieve the expression's right-hand side. |
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()
Compute the value of this expression clause and return the value as an AbleLiteral |
java.util.HashSet |
getVariableReferences()
Retrieve the set of variables (if any) referenced by this expression (and subexpressions) |
double |
getWeight()
Retrieve the weight used when the expression is converted to an antecedent clause. |
boolean |
isComplexExpression()
Returns true if either LHS or RHS args are AbleExpressions |
boolean |
isCompoundExpression()
Returns true if both LHS and RHS args are AbleExpressions |
boolean |
isConstant()
Returns true if this AbleRd object is a constant value false, if it does not. |
boolean |
isSimpleExpression()
Returns true if neither the LHS nor RHS args are AbleExpressions |
void |
setWeight(double theWeight)
Set the weight to the specified value. |
java.lang.String |
traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object. |
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, cmpEq, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, cmpNeq, compDivide, compMinus, compModulo, compMultiply, compPlus, compUnaryMinus, Copyright, getDataTypeAsString, getReferent, logicalAND, logicalNOT, logicalOR, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected AbleRd myLhs
protected int myOp
protected AbleRd myRhs
protected transient AbleRd myValue
This field is initialized by the constructor.
public static final double DefaultWeight
protected double myWeight
Constructor Detail |
public AbleExpression(AbleRd theLhs, int theOp, AbleRd theRhs)
If either the left-hand side or the right-hand side is a variable, and that variable is keeping track of clauses in which the variable is referenced, the variable's set of references is updated to point to this clause.
theLhs
- The left-hand side of the clause.
theOp
- A relational operator with which to evaluate the two
sides, or operands, of this clause. The value must be
an AbleData.<Operator> constant.
theRhs
- The right-hand side of the clause.
public AbleExpression(AbleDataContext theRuleSet, java.lang.String theExprString) throws AbleException
theRuleSet
- The data context used to parse the String into an expressiontheExprString
- The expression String.
Method Detail |
public AbleExpression createMatchExpression(java.util.Hashtable replacementVars)
public final AbleRd getLhs()
public final int getOp()
public java.lang.String getOpAsString()
public final AbleRd getRhs()
public java.util.BitSet getReferents()
getReferents
in class AbleLiteral
public java.lang.String traceString(int theTraceStringFlavor)
AbleLiteral
traceString
in class AbleLiteral
AbleLiteral.traceString(int)
public java.lang.String xmlCRdString()
AbleLiteral
xmlCRdString
in class AbleLiteral
AbleLiteral.xmlCRdString()
public java.lang.String arlCRdString()
AbleLiteral
arlCRdString
in class AbleLiteral
AbleLiteral.arlCRdString()
public java.util.Vector convertToConjunctiveNormalForm()
public java.util.Vector convertToDisjunctiveNormalForm()
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 AbleLiteral getValue() throws AbleDataException
getValue
in class AbleLiteral
AbleLiteral.getValue()
public java.lang.String getStringValue() throws AbleDataException
AbleLiteral
getStringValue
in class AbleLiteral
AbleLiteral.getStringValue()
public double getNumericValue() throws AbleDataException
AbleLiteral
getNumericValue
in class AbleLiteral
AbleLiteral.getNumericValue()
public java.lang.Object getGenericValue() throws AbleDataException
AbleLiteral
getGenericValue
in class AbleLiteral
AbleLiteral.getGenericValue()
public AbleFuzzySet getFuzzyValue() throws AbleDataException
AbleLiteral
getFuzzyValue
in class AbleLiteral
AbleLiteral.getFuzzyValue()
public boolean getBooleanValue() throws AbleDataException
AbleLiteral
getBooleanValue
in class AbleLiteral
AbleLiteral.getBooleanValue()
public java.lang.Class getDataTypeClass()
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 final void setWeight(double theWeight)
theWeight
- The new weight used if the expression is converted to an
antecedent clause.
public final double getWeight()
public java.util.HashSet getVariableReferences()
public boolean equals(AbleExpression theExpr)
For the expressions to be considered equal:
theAbleExpression
- The expression that is to be compared to this expression.
public boolean equals(java.lang.Object theExpr)
equals
in class java.lang.Object
public boolean isSimpleExpression()
public boolean isComplexExpression()
public boolean isCompoundExpression()
public boolean isConstant()
AbleRd
isConstant
in class AbleLiteral
public int getDataType()
AbleLiteral
getDataType
in class AbleLiteral
AbleRd.getDataType()
|
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 |