|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jeops.AbstractRuleBase
A generic rule base of Jeops. Objects of this class represent the pairs that it can be treated generically by any rule base.
| Constructor Summary | |
AbstractRuleBase(ObjectBase objectBase,
AbstractKnowledgeBase knowledgeBase)
Class constructor. |
|
| Method Summary | |
void |
assert(java.lang.Object obj)
Adds an object into this rule base. |
abstract boolean |
checkPrecForDeclaration(int ruleIndex,
int declIndex)
Checks whether all the preconditions of a rule which reference only the elements declared up to the given index are true. |
abstract boolean |
checkPrecondition(int ruleIndex,
int precIndex)
Checks whether some preconditions of some rule in this rule base is satisfied. |
java.lang.Object |
clone()
Creates a copy of this object. |
boolean |
equals(java.lang.Object obj)
|
void |
fireRule(int ruleIndex)
Fires one of the rules in this rule base. |
void |
flush()
Removes all the objects from this rule base. |
abstract java.util.Hashtable |
getClassDeclarationCount()
Returns a mapping from the classes of the objects declared in the rules to the number of occurrences of each one. |
abstract java.lang.Class |
getDeclaredClass(int ruleIndex,
int declarationIndex)
Returns the class of an object declared in a rule. |
abstract java.lang.String |
getDeclaredClassName(int ruleIndex,
int declarationIndex)
Returns the class name of an object declared in a rule. |
abstract java.util.Hashtable |
getInternalRuleMapping(int ruleIndex)
Returns a table that maps each declared identifier of a rule into its corresponding value. |
abstract java.lang.Object[][] |
getLocalDeclarationDependency(int ruleIndex)
Returns a dependency table between the local declarations and the regular ones. |
abstract int[] |
getNumberOfDeclarations()
Returns the number of declarations of the rules in this rule base. |
abstract int[] |
getNumberOfLocalDeclarations()
Returns the number of local declarations of the rules in this rule base. |
abstract int[] |
getNumberOfPreconditions()
Returns the number of preconditions of the rules in this rule base. |
abstract int |
getNumberOfRules()
Returns the number of rules in this base. |
abstract java.lang.Object |
getObject(int ruleIndex,
int declarationIndex)
Returns an object that represents a declaration of some rule. |
int |
getRuleIndex()
Returns the index of the rule that has the focus. |
abstract java.lang.String[] |
getRuleNames()
Returns the name of the rules in this rule base. |
int |
hashCode()
|
void |
modified(java.lang.Object obj)
Tells this base that an object was modified, so that the rules can be retested against the object. |
void |
retract(java.lang.Object obj)
Removes an object from this rule base. |
abstract void |
setObject(int ruleIndex,
int declarationIndex,
java.lang.Object value)
Sets an object that represents a declaration of some rule. |
void |
setRuleIndex(int value)
Defines the index of the rule that has the focus. |
| Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public AbstractRuleBase(ObjectBase objectBase,
AbstractKnowledgeBase knowledgeBase)
objectBase - an object base over with this rule base will work.knowledgeBase - the knowledge base that contains this rule base.| Method Detail |
public int getRuleIndex()
public void setRuleIndex(int value)
value - the index of the rule that has the focus.public abstract int getNumberOfRules()
public abstract boolean checkPrecondition(int ruleIndex,
int precIndex)
ruleIndex - the index of the rule to be checkedprecIndex - the index of the precondition to be checkedtrue if the corresponding precondition for the
given rule is satisfied. false otherwise.
public abstract boolean checkPrecForDeclaration(int ruleIndex,
int declIndex)
ruleIndex - the index of the rule to be checkeddeclIndex - the index of the declaration to be checkedtrue if all the preconditions of a rule which
reference only the elements declared up to the given index
are satisfied; false otherwise.public abstract java.util.Hashtable getInternalRuleMapping(int ruleIndex)
ruleIndex - the index of the rule whose mapping is required.public void fireRule(int ruleIndex)
ruleIndex - the index of the rule to be fired.public abstract int[] getNumberOfPreconditions()
public abstract int[] getNumberOfDeclarations()
public abstract int[] getNumberOfLocalDeclarations()
public abstract java.lang.String[] getRuleNames()
public abstract java.util.Hashtable getClassDeclarationCount()
public abstract java.lang.String getDeclaredClassName(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration.
public abstract java.lang.Class getDeclaredClass(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration.
public abstract void setObject(int ruleIndex,
int declarationIndex,
java.lang.Object value)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration in the rulevalue - the value of the object being set.
public abstract java.lang.Object getObject(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration in the rulepublic abstract java.lang.Object[][] getLocalDeclarationDependency(int ruleIndex)
ruleIndex - the index of the rule.public boolean equals(java.lang.Object obj)
public int hashCode()
public void assert(java.lang.Object obj)
obj - the object to be inserted into this base.public void retract(java.lang.Object obj)
obj - the object to be removed from this base.public void flush()
public void modified(java.lang.Object obj)
obj - the object that was modified.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||