|
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.AblePredicateLib
This class implements an alternate math library that takes/returns AbleDoubleLiterals as arguments and defines: plus, minus, times, divideBy for use by Predicate engine.
This class provides a library of mathematical user-defined functions that can be imported into an Able ruleset with an Import() statement. Each public method in this class can then be used as a user-defined function.
Field Summary | |
---|---|
protected AbleWorkingMemory |
myWm
|
Constructor Summary | |
---|---|
AblePredicateLib()
Create a new math library of user-defined function routines. |
Method Summary | |
---|---|
boolean |
assertFact(java.lang.Object fact)
|
static java.lang.String |
Copyright()
Determine the copyright of this class. |
AbleDoubleLiteral |
divideBy(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Divide A by B and return the result. |
boolean |
getAnswer(AbleRuleSet theRuleSet)
Return the answer. |
java.util.Vector |
getGroundSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockName,
int theIndex)
Return the solution at the specified index in the solutionList. |
java.util.Vector |
getSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockName,
int theIndex)
Return the solution at the specified index in the solutionList. |
java.util.Vector |
getSolutionList(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockName)
Return the solutionList. |
AbleDoubleLiteral |
minus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Subtract B from A and return the result. |
AbleDoubleLiteral |
plus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Add two numbers and return the result. |
boolean |
retractFact(java.lang.Object fact)
|
void |
setPredicateWorkingMemory(AbleWorkingMemory wm)
|
AbleDoubleLiteral |
times(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Multiply B by A and return the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AbleWorkingMemory myWm
Constructor Detail |
public AblePredicateLib()
Method Detail |
public AbleDoubleLiteral plus(java.lang.Object theNumberA, java.lang.Object theNumberB) throws AbleDataException
theNumberA
- A number.
theNumberB
- A number.
public AbleDoubleLiteral minus(java.lang.Object theNumberA, java.lang.Object theNumberB) throws AbleDataException
theNumberA
- A number.
theNumberB
- A number.
public AbleDoubleLiteral times(java.lang.Object theNumberA, java.lang.Object theNumberB) throws AbleDataException
theNumberA
- A number.
theNumberB
- A number.
public AbleDoubleLiteral divideBy(java.lang.Object theNumberA, java.lang.Object theNumberB) throws AbleDataException
theNumberA
- The dividend number.
theNumberB
- The divisor number.
public java.util.Vector getSolutionList(AbleRuleSet theRuleSet, java.lang.String theRuleBlockName) throws AbleException
theRuleSet
- public java.util.Vector getSolution(AbleRuleSet theRuleSet, java.lang.String theRuleBlockName, int theIndex) throws AbleException
theRuleSet
- theRuleBlockName
- The name of the ruleblocktheIndex
- The index of the element in the solutionList to returnpublic java.util.Vector getGroundSolution(AbleRuleSet theRuleSet, java.lang.String theRuleBlockName, int theIndex) throws AbleException
theRuleSet
- theRuleBlockName
- The name of the ruleblocktheIndex
- The index of the element in the solutionList to returnpublic boolean getAnswer(AbleRuleSet theRuleSet) throws AbleException
public void setPredicateWorkingMemory(AbleWorkingMemory wm)
public boolean assertFact(java.lang.Object fact)
public boolean retractFact(java.lang.Object fact)
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 |