jeops.engine
Class LRURuleSorter

java.lang.Object
  |
  +--jeops.engine.RuleSorter
        |
        +--jeops.engine.LRURuleSorter

public class LRURuleSorter
extends RuleSorter

A rule sorter that will fire the least recently used rule.

Version:
0.01 13 Dez 1998
Author:
Carlos Figueira Filho (csff@di.ufpe.br)
See Also:
ConflictSet

Constructor Summary
LRURuleSorter()
          Class constructor.
 
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 jeops.engine.RuleSorter
isEmpty, removeNonFireableRules, removeRule, removeRulesWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LRURuleSorter

public LRURuleSorter()
Class constructor.
Method Detail

flush

public void flush()
Removes all rules of this sorter.
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 moved to the "end of the firing line".
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.