|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.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 AbleLocation |
myLocation
The location of this expression in the source ARL file. |
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.lang.String |
armlCRdString()
|
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 theAbleExpression)
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. |
AbleLocation |
getLocation()
Returns the location of the expression in the source ARL file |
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. |
int |
hashCode()
|
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 |
setLocation(AbleLocation theLocation)
Set the location of the expression in the source ARL file |
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, getDataTypeAsString, getReferent, logicalAND, logicalNOT, logicalOR, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, 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
protected AbleLocation myLocation
| 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 interface AbleRdgetReferents in class AbleLiteralpublic java.lang.String traceString(int theTraceStringFlavor)
AbleLiteral
traceString in interface AbleRdtraceString in class AbleLiteraltheTraceStringFlavor - An AbleRuleSet.TraceStringFlavor value.
AbleLiteral.traceString(int)public java.lang.String xmlCRdString()
AbleLiteral
xmlCRdString in interface AbleRdxmlCRdString in class AbleLiteralAbleLiteral.xmlCRdString()public java.lang.String armlCRdString()
AbleLiteral.xmlCRdString()public java.lang.String arlCRdString()
AbleLiteral
arlCRdString in interface AbleRdarlCRdString in class AbleLiteralAbleLiteral.arlCRdString()public java.util.Vector convertToConjunctiveNormalForm()
public java.util.Vector convertToDisjunctiveNormalForm()
public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
getTemplateString in interface AbleRdgetTemplateString in class AbleLiteraltheTemplateVars - An ordered list of template variables referenced by this rule.
public AbleLiteral getValue()
throws AbleDataException
getValue in interface AbleRdgetValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a literal.AbleLiteral.getValue()
public java.lang.String getStringValue()
throws AbleDataException
AbleLiteral
getStringValue in interface AbleRdgetStringValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a string value.AbleLiteral.getStringValue()
public double getNumericValue()
throws AbleDataException
AbleLiteral
getNumericValue in interface AbleRdgetNumericValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a numeric value.AbleLiteral.getNumericValue()
public java.lang.Object getGenericValue()
throws AbleDataException
AbleLiteral
getGenericValue in interface AbleRdgetGenericValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
an Object.AbleLiteral.getGenericValue()
public AbleFuzzySet getFuzzyValue()
throws AbleDataException
AbleLiteral
getFuzzyValue in interface AbleRdgetFuzzyValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a fuzzy value.AbleLiteral.getFuzzyValue()
public boolean getBooleanValue()
throws AbleDataException
AbleLiteral
getBooleanValue in interface AbleRdgetBooleanValue in class AbleLiteralAbleDataException - If the value of this object cannot be represented as
a boolean value.AbleLiteral.getBooleanValue()public java.lang.Class getDataTypeClass()
getDataTypeClass in interface AbleRdgetDataTypeClass in class AbleLiteralpublic java.lang.String getDataTypeClassName()
AbleLiteral
getDataTypeClassName in interface AbleRdgetDataTypeClassName in class AbleLiteralpublic 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 theAbleExpression)
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)
public int hashCode()
public boolean isSimpleExpression()
public boolean isComplexExpression()
public boolean isCompoundExpression()
public boolean isConstant()
AbleRd
isConstant in interface AbleRdisConstant in class AbleLiteralpublic int getDataType()
AbleLiteral
getDataType in interface AbleRdgetDataType in class AbleLiteralAbleRd.getDataType()public void setLocation(AbleLocation theLocation)
public AbleLocation getLocation()
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||