jeops.engine
Class OneShotRuleSorter
java.lang.Object
|
+--jeops.engine.RuleSorter
|
+--jeops.engine.OneShotRuleSorter
- public class OneShotRuleSorter
- extends RuleSorter
A rule sorter that will fire each rule only once, even if it has
more than one possible instantiations.
- Version:
- 0.01 08 Dez 1998
- Author:
- Carlos Figueira Filho (csff@di.ufpe.br)
- See Also:
ConflictSet
Method Summary |
void |
flush()
Removes all rules of this sorter. |
void |
insertRule(Rule rule)
Inserts a rule in this sorter. |
Rule |
nextRule()
Returns the next rule to be fired. |
void |
ruleRemoved(java.lang.String ruleName)
Callback method, used to inform this class that a rule was
removed from this sorter. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
OneShotRuleSorter
public OneShotRuleSorter()
- Class constructor.
flush
public void flush()
- Removes all rules of this sorter. Also, clears the history of the
rules that have already been fired.
- Overrides:
- flush in class RuleSorter
insertRule
public void insertRule(Rule rule)
- Inserts a rule in this sorter.
- Overrides:
- insertRule in class RuleSorter
- Parameters:
rule
- the rule to be inserted.
nextRule
public Rule nextRule()
throws NoMoreRulesException
- Returns the next rule to be fired. In the return of this method,
the symbolic table of the table shall be correctly filled. Also,
after this method has been called, all instanciations of the rule
are removed from the conflict set.
- Overrides:
- nextRule in class RuleSorter
- Returns:
- the rule to be fired, among those that have been inserted
in this object, according to the policy defined in this
class.
ruleRemoved
public void ruleRemoved(java.lang.String ruleName)
- Callback method, used to inform this class that a rule was
removed from this sorter. It won't be needed.
- Parameters:
ruleName
- the name of the removed rule.