org.cfpm.caves.za
Class EndorsementDisposalPolicy

java.lang.Object
  extended by org.cfpm.caves.za.DisposalPolicy
      extended by org.cfpm.caves.za.EndorsementDisposalPolicy

public class EndorsementDisposalPolicy
extends DisposalPolicy

This class is a specialisation of DisposalPolicy, able to include endorsement facts. This is necessary because the fact header of endorsement facts (endorsed) is the same for all endorsements and the differentiation of removal or not has to be made based on the actual endorsement (slot endorsement). All endorsement facts have the default time stamp slot tickStamp.

Author:
Ruth

Field Summary
(package private)  java.util.HashMap<java.lang.String,java.lang.Integer> endorsementFilter
          the list of endorsement filters (key = endorsement token, value = time lag)
 
Fields inherited from class org.cfpm.caves.za.DisposalPolicy
context, engine, policy, timedSlots
 
Constructor Summary
EndorsementDisposalPolicy(jess.Rete engine)
          Creates a new empty endorsement disposal policy
 
Method Summary
 void addEndorsementPolicy(java.lang.String endorsementToken, int lag)
          adds a new endorsement policy
protected  void determineDisposalList(java.util.Iterator factList, java.util.ArrayList<jess.Fact> disposalList, int tick)
          The strategy applied to determine which facts fit the defined policies and should therefore be removed.
 
Methods inherited from class org.cfpm.caves.za.DisposalPolicy
addPolicy, addPolicy, executePolicy, removePolicy, setPolicy, setPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endorsementFilter

java.util.HashMap<java.lang.String,java.lang.Integer> endorsementFilter
the list of endorsement filters (key = endorsement token, value = time lag)

Constructor Detail

EndorsementDisposalPolicy

public EndorsementDisposalPolicy(jess.Rete engine)
Creates a new empty endorsement disposal policy

Parameters:
engine - the Jess engine
Method Detail

addEndorsementPolicy

public void addEndorsementPolicy(java.lang.String endorsementToken,
                                 int lag)
adds a new endorsement policy

Parameters:
endorsementToken - the endorsement token
lag - the time lag

determineDisposalList

protected void determineDisposalList(java.util.Iterator factList,
                                     java.util.ArrayList<jess.Fact> disposalList,
                                     int tick)
The strategy applied to determine which facts fit the defined policies and should therefore be removed. Collects all fitting facts in a disposal list.

Overrides:
determineDisposalList in class DisposalPolicy
Parameters:
factList - the list of all facts to be checked
disposalList - the list of facts to be removed from the fact base
tick - the current tick