|
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.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(AbleRuleSet theRuleSet,
java.lang.String theVariableName,
AbleExpression theConstraintExpression)
Construct a selector object from the specified variable name and expression. |
|
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.Object |
any(AbleOclCollection theCollection)
From the specified collection, find and return the first element that satisfies the contained expression. |
java.lang.String |
arlString()
Return a formal ARL string that describes this clause. |
java.lang.String |
armlString()
Return a formal XML string that describes this clause. |
AbleOclCollection |
collect(AbleOclCollection theCollection)
Collect the values returned when the expression is evaluated against each element of the specified collection. |
void |
convertExpressionToClauses(AbleRuleSet theRuleSet)
Convert the constraintExpression to a Vector of AbleAntecedentClauses |
boolean |
exists(AbleOclCollection theCollection)
Determine whether the collection contains at least one element for which the expression evaluates to true. |
boolean |
forAll(AbleOclCollection theCollection)
Determine whether all elements of the collection are true for the contained expression expression. |
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) |
boolean |
isUnique(AbleOclCollection theCollection)
Determine whether the expression evaluates to a unique value for each element of the specified collection. |
java.util.Vector |
match(AbleWorkingMemory workingMemory)
Find a list of matching instances in working memory |
boolean |
one(AbleOclCollection theCollection)
From the specified collection, find and return the first element that satisfies the contained expression. |
AbleOclCollection |
reject(AbleOclCollection theCollection)
From the specified collection, create a list of those elements that evaluate to false against the contained expression. |
AbleOclCollection |
select(AbleOclCollection theCollection)
From the specified collection, create a list of those elements that evaluate to true against the contained expression. |
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 objects
public 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 negative
public AbleSelector(AbleVariable selector,
AbleExpression constraintExpr,
boolean positive)
selector - The selector variableconstraintExpr - A constraint expression bound to the selector variable.positive - A boolean , true if the selector is positive, false if negative
public AbleSelector(AbleVariable selector,
java.lang.Object constraintExpr,
boolean positive)
throws AbleParException
selector - The selector variable.constraintExpr - An AbleExpression bound to the selector variable.
The constraints are AbleAntecedentClause objects.positive - A boolean, true if the selector is positive, false if negative.
public AbleSelector(AbleRuleSet theRuleSet,
java.lang.String theVariableName,
AbleExpression theConstraintExpression)
theRuleSet - The ruleset in which this selector is evaluated.
theVariableName - The name of the selector variable; it must identify a
variable declared within the specified ruleset.
theConstraintExpression - An expression that, when evaluated with an instance of
the specified variable, must return a boolean value.
| Method 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 searched
AbleDataException
public boolean exists(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public boolean forAll(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public boolean isUnique(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public java.lang.Object any(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public boolean one(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public AbleOclCollection collect(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public AbleOclCollection select(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataException
public AbleOclCollection reject(AbleOclCollection theCollection)
throws AbleDataException
theCollection - The collection of elements to examine.
AbleDataExceptionpublic AbleVariable getSelectorVariable()
public java.lang.Object getSelectorValue()
throws AbleDataException
AbleDataExceptionpublic 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 armlString()
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.
AbleDataExceptionAbleRuleTemplatepublic java.lang.String traceString(int theTraceStringFlavor)
theTraceStringFlavor - An Able.TraceStringFlavor value.
|
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 | |||||||||||