|
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.rules.AbleClause | +--com.ibm.able.rules.AbleAntecedentClause
This class is used to represent an antecedent boolean or fuzzy expression in a conditional if-then rule. When evaluated using boolean logic, an antecedent clause can return one of three values as its truth value: true, false, and null, which is the case if either of the clause's arguments is null. Each time an antecedent clause is evaluated in boolean logic, the truth value is cached. This helps prevent the clause from being re-valuated unnecessarily.
When evaluated in fuzzy logic, a fuzzy truth value is returned, which may be influenced by the clause's weight.
Field Summary | |
---|---|
static double |
ClauseWeightDefault
A default weight. |
protected java.lang.Boolean |
myBooleanTruth
myBooleanTruth contains the current truth value of this clause, but only if the clause has been evaluated. |
protected double |
myClauseWeight
myClauseWeight represents the weight that this clause is to assume when the clause is evaluated. |
Fields inherited from class com.ibm.able.rules.AbleClause |
---|
myLhs, myOp, myRhs, myRuleRefs |
Constructor Summary | |
---|---|
AbleAntecedentClause(AbleExpression theExpression)
Create a new clause from the specified expression. |
|
AbleAntecedentClause(AbleRd theLhs,
int theOp,
AbleRd theRhs)
Create a new clause with the specified parts. |
|
AbleAntecedentClause(AbleRd theLhs,
int theOp,
AbleRd theRhs,
double theClauseWeight)
Create a new antecedent clause with the specified parts. |
Method Summary | |
---|---|
java.lang.String |
arlString()
Return a formal ARL string that describes this clause. |
AbleAntecedentClause |
createMatchClause(java.util.Hashtable replacementVars)
Create a duplicate of this clause using replacement vars |
protected boolean |
equals(AbleAntecedentClause theAbleClause)
Determine whether this clause is equal to some other clause. |
java.lang.Boolean |
getBooleanTruth()
Retrieve the clause's truth value. |
double |
getClauseWeight()
Retrieve the clause's weight. |
java.lang.String |
getTemplateString(java.util.Vector theTemplateVars)
Retrieve a text format string for use by rule templates. |
void |
setBooleanTruth(java.lang.Boolean theTruth)
Set the clause's truth value. |
void |
setClauseWeight(double theClauseWeight)
Set the clause's weight to the specified value. |
java.lang.String |
toString()
Retrieve a string describing (the contents of) the object. |
java.lang.String |
traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object. |
java.lang.String |
xmlString()
Return a formal XML string that describes this clause. |
Methods inherited from class com.ibm.able.rules.AbleClause |
---|
addRuleRef, Copyright, equals, getLhs, getLhsReferent, getOp, getOpAsString, getReferent, getReferents, getRhs, getRhsReferent, getRule, getRuleRefs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double ClauseWeightDefault
protected double myClauseWeight
protected java.lang.Boolean myBooleanTruth
Constructor Detail |
public AbleAntecedentClause(AbleRd theLhs, int theOp, AbleRd theRhs, double theClauseWeight)
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.
theClauseWeight
- The weight of the clause (used by Fuzzy engine only).
public AbleAntecedentClause(AbleRd theLhs, int theOp, AbleRd theRhs)
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 AbleAntecedentClause(AbleExpression theExpression) throws AbleDataException
theExpression
- A simple boolean expression with an optional weightMethod Detail |
public AbleAntecedentClause createMatchClause(java.util.Hashtable replacementVars)
public java.lang.String arlString()
For antecedent clauses, add the weight of the clause, but only if the weight is something other than the default weight.
arlString
in class AbleClause
public java.lang.String xmlString()
For antecedent clauses, add the weight of the clause, but only if the weight is something other than the default weight.
xmlString
in class AbleClause
public java.lang.String getTemplateString(java.util.Vector theTemplateVars)
theTemplateVars
- An ordered list of template variables referenced by this rule.AbleRuleTemplate
public final void setClauseWeight(double theClauseWeight)
theClauseWeight
- The new weight of the clause.
public final double getClauseWeight()
public final void setBooleanTruth(java.lang.Boolean theTruth)
theTruth
- true if the clause evaluates to true;
false if the clause evaluates to false;
null if the truth value is unknown.public final java.lang.Boolean getBooleanTruth()
protected boolean equals(AbleAntecedentClause theAbleClause)
For the clauses to be considered equal:
theAbleClause
- The clause that is to be compared to this clause.
public java.lang.String toString()
toString
in class AbleClause
public java.lang.String traceString(int theTraceStringFlavor)
traceString
in class AbleClause
theFlavor
- An Able.TraceStringFlavor value.
|
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 |