|
|||||||||
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 rule bases that can be treated generically by any knowledge base.
Field Summary | |
private AbstractKnowledgeBase |
knowledgeBase
The knowledge base that contains this rule base. |
private int |
ruleIndex
The index of the rule that has the focus. |
Constructor Summary | |
AbstractRuleBase(AbstractKnowledgeBase knowledgeBase)
Class constructor. |
Method Summary | |
void |
assert(java.lang.Object obj)
Adds an object into this rule base. |
abstract boolean |
checkCondForDeclaration(int ruleIndex,
int declIndex)
Checks whether all the conditions of a rule which reference only the elements declared up to the given index are true. |
abstract boolean |
checkCondition(int ruleIndex,
int condIndex)
Checks whether a condition of some rule in this rule base is satisfied. |
abstract boolean |
checkConditionsOnlyOf(int ruleIndex,
int declIndex)
Checks whether all conditions of some rule that depend only on the given object are satisfied, not counting the local declarations. |
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.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.lang.String[] |
getDeclaredIdentifiers(int ruleIndex)
Returns the identifiers declared in a given rule. |
abstract int[] |
getNumberOfConditions()
Returns the number of conditions of the rules in this rule base. |
abstract int[] |
getNumberOfDeclarations()
Returns the number of declarations 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. |
abstract java.lang.Object[] |
getObjects(int ruleIndex)
Returns all variables bound to the declarations 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()
|
protected abstract void |
internalFireRule(int ruleIndex)
Fires one of the rules in this rule base. |
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. |
abstract void |
setObjects(int ruleIndex,
java.lang.Object[] objects)
Defines all variables bound to the declarations of some rule. |
void |
setRuleIndex(int value)
Defines the index of the rule that has the focus. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private AbstractKnowledgeBase knowledgeBase
private int ruleIndex
Constructor Detail |
public AbstractRuleBase(AbstractKnowledgeBase knowledgeBase)
knowledgeBase
- the knowledge base that contains this rule base.Method Detail |
public void assert(java.lang.Object obj)
obj
- the object to be inserted into this base.public abstract boolean checkConditionsOnlyOf(int ruleIndex, int declIndex)
ruleIndex
- the index of the rule to be checkeddeclIndex
- the index of the declaration to be checkedtrue
if all corresponding conditions for
the given rule are satisfied;
false
otherwise.public abstract boolean checkCondForDeclaration(int ruleIndex, int declIndex)
ruleIndex
- the index of the rule to be checkeddeclIndex
- the index of the declaration to be checkedtrue
if all the conditions of a rule which
reference only the elements declared up to the given index
are satisfied; false
otherwise.public abstract boolean checkCondition(int ruleIndex, int condIndex)
ruleIndex
- the index of the rule to be checkedcondIndex
- the index of the condition to be checkedtrue
if the corresponding condition for the
given rule is satisfied. false
otherwise.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
public void fireRule(int ruleIndex)
ruleIndex
- the index of the rule to be fired.public void flush()
public abstract java.lang.Class getDeclaredClass(int ruleIndex, int declarationIndex)
ruleIndex
- the index of the ruledeclarationIndex
- the index of the declaration.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.String[] getDeclaredIdentifiers(int ruleIndex)
ruleIndex
- the index of the rule.public abstract int[] getNumberOfDeclarations()
public abstract int[] getNumberOfConditions()
public abstract int getNumberOfRules()
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[] getObjects(int ruleIndex)
ruleIndex
- the index of the rulepublic int getRuleIndex()
public abstract java.lang.String[] getRuleNames()
public int hashCode()
protected abstract void internalFireRule(int ruleIndex)
ruleIndex
- the index of the rule to be fired.public void modified(java.lang.Object obj)
obj
- the object that was modified.public void retract(java.lang.Object obj)
obj
- the object to be removed from this base.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 void setObjects(int ruleIndex, java.lang.Object[] objects)
ruleIndex
- the index of the ruleobjects
- an an object array of the variables bound to the
declarations of some rule.public void setRuleIndex(int value)
value
- the index of the rule that has the focus.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |