|
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.AbleSelector
This class represents a single AbleVariable (the selected variable) and a set of constraints on the value that variable can take.
Selectors are created as part of when/do pattern match rules and directly via use of Selector data types in the Able Rule Language.
Field Summary | |
---|---|
protected AbleExpression |
constraintExpr
|
protected java.util.Vector |
constraints
|
protected AbleRuleSet |
myRuleSet
|
protected boolean |
positive
|
protected AbleVariable |
selectorVariable
|
Constructor Summary | |
---|---|
AbleSelector()
Create an AbleSelector object |
|
AbleSelector(AbleRuleSet theRuleSet,
AbleVariable selector,
java.util.Vector constraints,
boolean positive)
Construct a selector object |
|
AbleSelector(AbleVariable selector,
AbleExpression constraintExpr,
boolean positive)
Construct a selector object |
|
AbleSelector(AbleVariable selector,
java.lang.Object constraintExpr,
boolean positive)
Construct a selector object |
|
AbleSelector(AbleVariable selector,
java.util.Vector constraints)
Create an AbleSelector object |
Method Summary | |
---|---|
void |
addConstraint(java.lang.Object constraint)
Add a Clause or Predicate constraint to this selector |
java.lang.String |
arlString()
Return a formal ARL string that describes this clause. |
void |
convertExpressionToClauses(AbleRuleSet theRuleSet)
Convert the constraintExpression to a Vector of AbleAntecedentClauses |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
AbleExpression |
getConstraintExpression()
Retrieve the constraint expression |
java.util.Vector |
getConstraints()
Retrieve the list of constraints (antecedent clauses) |
java.lang.Object |
getSelectorValue()
Return the value of the selector variable |
AbleVariable |
getSelectorVariable()
Return the selector variable |
java.lang.String |
getTemplateString(java.util.Vector theTemplateVars)
Retrieve a text format string for use by rule templates. |
boolean |
isNegative()
Check if selector is negative (checking for patterns that don't exist) |
boolean |
isPositive()
Check if selector is positive (looking for matches) |
java.util.Vector |
match(AbleWorkingMemory workingMemory)
Find a list of matching instances in working memory |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector constraints
protected AbleVariable selectorVariable
protected boolean positive
protected AbleExpression constraintExpr
protected AbleRuleSet myRuleSet
Constructor Detail |
public AbleSelector()
public AbleSelector(AbleVariable selector, java.util.Vector constraints)
selector
- The selector variableconstraints
- A vector of constraints on the values bound to the selector variable
The constraints are AbleAntecedentClause objectspublic AbleSelector(AbleRuleSet theRuleSet, AbleVariable selector, java.util.Vector constraints, boolean positive)
theRuleSet
- The ruleset object this selector belongs toselector
- The selector variableconstraints
- A vector of constraints on the values bound to the selector variable
The constraints are AbleAntecedentClause objectspositive
- A boolean , true if the selector is positive, false if negativepublic AbleSelector(AbleVariable selector, AbleExpression constraintExpr, boolean positive)
theRuleSet
- The ruleset object this selector belongs toselector
- The selector variableconstraints
- A vector of constraints on the values bound to the selector variable
The constraints are AbleAntecedentClause objectspositive
- A boolean , true if the selector is positive, false if negativepublic AbleSelector(AbleVariable selector, java.lang.Object constraintExpr, boolean positive) throws AbleParException
selector
- The selector variableconstraints
- A vector of constraints on the values bound to the selector variable
The constraints are AbleAntecedentClause objectspositive
- A boolean , true if the selector is positive, false if negativeMethod Detail |
public void addConstraint(java.lang.Object constraint)
constraint
- An AntecedentClause that places a constraint on instances bound to the selectorpublic boolean isPositive()
public boolean isNegative()
public java.util.Vector match(AbleWorkingMemory workingMemory) throws AbleDataException
workingMemory
- The associated working memory to be searchedpublic AbleVariable getSelectorVariable()
public java.lang.Object getSelectorValue() throws AbleDataException
public java.util.Vector getConstraints()
public AbleExpression getConstraintExpression()
public void convertExpressionToClauses(AbleRuleSet theRuleSet)
theRuleSet
- An AbleRuleSet objetpublic 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.
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.
public java.lang.String getTemplateString(java.util.Vector theTemplateVars) throws AbleDataException
theTemplateVars
- An ordered list of template variables referenced by this selector.AbleRuleTemplate
public java.lang.String traceString(int theTraceStringFlavor)
theFlavor
- An Able.TraceStringFlavor value.
public static java.lang.String Copyright()
|
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 |