|
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.AbleRule | +--com.ibm.able.rules.AblePredicateRule
This class represents a predicate rule (or Horn clause) containing one or more antecedent clauses (logically ANDed together) (the body) and one and only one predicate consequent clause (the head).
Field Summary | |
---|---|
protected static int |
copyId
|
protected java.util.Vector |
myAntecedents
myAntecedents is a list of AbleAntecedentClause objects. |
protected AblePredicate |
myConsequent
myConsequent is a single predicate clause or head of the rule. |
protected java.util.Vector |
myCuts
Vector of cut() predicates in the antecedent list (null if none) |
protected java.util.Vector |
myVariables
myVariables is a list of all of the AbleVariable objects that appear in the rule (body and head). |
Fields inherited from class com.ibm.able.rules.AbleRule |
---|
myBooleanTruth, myBreakpoint, myComment, myEnabled, myFiredCount, myFiredFlag, myId, myLabel, myLocation, myPreConditions, myPriority, myPrompt, myRdRefs, myRuleSet, myTemplateFlag, myTemplateName, myTemplateValues, myWrRefs, PriorityDefault, RuleIdInitial |
Constructor Summary | |
---|---|
AblePredicateRule(int theId,
java.lang.String theLabel,
AbleRd thePriority,
AbleRuleSet theRuleSet)
Create a new predicate fact with the specified id, label, priority, and tracer |
|
AblePredicateRule(int theId,
java.lang.String theLabel,
AbleRd thePriority,
java.util.Vector theAntecedents,
AblePredicate theConsequent,
AbleRuleSet theRuleSet)
Create a new predicate rule with the specified priority, antecedent clauses, and consequent clause. |
|
AblePredicateRule(int theId,
java.lang.String theLabel,
java.util.Vector theAntecedents,
AblePredicate theConsequent,
AbleRuleSet theRuleSet)
Create a new predicate rule with the specified antecedent clauses and consequent clause. |
|
AblePredicateRule(java.lang.String theLabel,
AbleRd thePriority,
java.util.Vector theAntecedents,
AblePredicate theConsequent,
AbleRuleSet theRuleSet)
Create a new predicate rule with the specified priority, antecedent clauses, and consequent clause. |
|
AblePredicateRule(java.lang.String theLabel,
java.util.Vector theAntecedents,
AblePredicate theConsequent,
AbleRuleSet theRuleSet)
Create a new predicate rule with the specified antecedent clauses and consequent clause. |
Method Summary | |
---|---|
void |
applyBindings(java.util.Vector bindings)
|
java.lang.String |
arlString()
Return a formal Able Rule Language (ARL) String. |
AblePredicateRule |
createMatchRule()
Create a duplicate of this rule with new variables |
void |
displayBindings(java.util.Vector bindings)
|
protected void |
findAllVariables()
Find all variables that appear in this rule Also looks for any cut() predicates in the antecedent clauses |
java.util.Vector |
getAntecedents()
Retrieve the rule's list of antecedent clauses. |
java.util.Vector |
getBindings()
Create a Vector of all variables and their current values |
AblePredicate |
getConsequent()
Retrieve the rule's consequent clause, if any. |
java.util.Vector |
getCuts()
Retrieves a list of cut() predicates (if any), null (if none) |
java.lang.String |
getSignature()
Returns the signature of the rule head (consequent) |
java.lang.String |
getTemplateString(java.util.Vector theTemplateVars)
Retrieve a text format string for use by rule templates. |
long |
numberOfAntecedents()
Retrieve the number of antecedent clauses in this rule. |
void |
reset()
Reset the rule to its unfired state. |
void |
resetAllVariables()
Clear all variables |
void |
setBindings(java.util.Vector bindings)
Apply these bindings to this rule Bindings are Variable-Value pairs |
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. |
protected java.lang.String |
trcString(int theTraceStringFlavor)
|
java.lang.String |
xmlString()
Return a formal XML string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static int copyId
protected java.util.Vector myAntecedents
protected AblePredicate myConsequent
protected java.util.Vector myVariables
protected java.util.Vector myCuts
Constructor Detail |
public AblePredicateRule(java.lang.String theLabel, java.util.Vector theAntecedents, AblePredicate theConsequent, AbleRuleSet theRuleSet)
theLabel
- The unique label, or name, of this rule.
theAntecedents
- A list of AbleAntecedentClause objects that define the
antecedents of this rule. The list is cloned.
theConsequent
- A single assignment statement that defines the
consequent of this rule.
theRuleSet
- The ruleset object this rule belongs to.public AblePredicateRule(java.lang.String theLabel, AbleRd thePriority, java.util.Vector theAntecedents, AblePredicate theConsequent, AbleRuleSet theRuleSet)
theLabel
- The unique label, or name, of this rule.
thePriority
- The priority of this rule.
theAntecedents
- A list of AbleAntecedentClause objects that define the
antecedents of this rule. The list is cloned.
theConsequent
- A single assignment statement that defines the
consequent of this rule.
theRuleSet
- The ruleset object this rule belongs to.public AblePredicateRule(int theId, java.lang.String theLabel, java.util.Vector theAntecedents, AblePredicate theConsequent, AbleRuleSet theRuleSet)
theId
- The unique Id of this rule.
theLabel
- The unique label, or name, of this rule.
theAntecedents
- A list of AbleAntecedentClause objects that define the
antecedents of this rule. The list is cloned.
theConsequent
- A single assignment statement that defines the
consequent of this rule.
theRuleSet
- A ruleset object to which this rule belongs.
public AblePredicateRule(int theId, java.lang.String theLabel, AbleRd thePriority, java.util.Vector theAntecedents, AblePredicate theConsequent, AbleRuleSet theRuleSet)
theId
- The unique Id of this rule.
theLabel
- The unique label, or name, of this rule.
thePriority
- The priority of this rule. (ignored by predicate engine)
theAntecedents
- A list of AbleAntecedentClause objects that define the
antecedents of this rule. The list is cloned.
theConsequent
- A single assignment statement that defines the
consequent of this rule.
theRuleSet
- A ruleset object to which this rule belongs.
public AblePredicateRule(int theId, java.lang.String theLabel, AbleRd thePriority, AbleRuleSet theRuleSet)
theId
- The unique Id of this rule.
theLabel
- The unique label, or name, of this rule.
thePriority
- The priority of this rule.
theRuleSet
- A ruleset object to which this rule belongs.
Method Detail |
public AblePredicateRule createMatchRule()
protected void findAllVariables()
public java.util.Vector getAntecedents()
public long numberOfAntecedents()
public AblePredicate getConsequent()
public java.lang.String getSignature()
public void reset()
reset
in class AbleRule
public java.util.Vector getCuts()
public void resetAllVariables()
public java.lang.String arlString()
arlString
in class AbleRule
public java.lang.String xmlString()
xmlString
in class AbleRule
public void setBindings(java.util.Vector bindings) throws AbleDataException
public java.util.Vector getBindings() throws AbleDataException
public void applyBindings(java.util.Vector bindings) throws AbleDataException
public void displayBindings(java.util.Vector bindings) throws AbleDataException
public java.lang.String getTemplateString(java.util.Vector theTemplateVars) throws AbleDataException
getTemplateString
in class AbleRule
theTemplateVars
- An ordered list of template variables referenced by this rule.AbleRuleTemplate
public java.lang.String toString()
toString
in class AbleRule
public java.lang.String traceString(int theTraceStringFlavor)
traceString
in class AbleRule
theFlavor
- An Able.TraceStringFlavor value.
protected java.lang.String trcString(int theTraceStringFlavor)
|
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 |