Class logic.Rules
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class logic.Rules

Object
   |
   +----logic.Rules

public class Rules
extends Object
implements Updateable
This class encapsulates the notion of a set of rules that match a sequence of booleans with an action. The underlying container of these match-ups is a Hashtable. The Rules class provides an interface to this underlying data structure with addRule(..) and lookUp(..)


Variable Index

 o MAX_NUMBER_CONDITIONS

Constructor Index

 o logic.Rules(int, int, int)
Precondition: The user has set all requested options: consistency checking, choice of algorithm, or neither Typically, Rules should be instantiated in the loadRules method of a concrete subclass of Invoker.
 o logic.Rules(int, int, int, Algorithm, Boolean)
This version of the constructor is used if either consistency checking or a specific algorithm are to be selected.
 o logic.Rules(int, int, int, Algorithm, Boolean, boolean)
This version of the constructor is like the last one, but allows you to switch off safetyOn, which is used in the abortIfDangerous() safety check

Method Index

 o addRule(String, Action)
 o doUpdate(Hashtable)
This is the implementation of Updateable, used to select algorithm, set consistency checking flag, and set exception
 o getAlgorithm()
 o getAvgNumStars()
 o getConsistencyChecking()
 o getNumRules()
 o lookUp(Vector)

Variables

 o MAX_NUMBER_CONDITIONS
public static final int MAX_NUMBER_CONDITIONS

Constructors

 o Rules
public Rules(int numConditions,
             int numRules,
             int maxNumStars) throws PoorPerformanceException
Precondition: The user has set all requested options: consistency checking, choice of algorithm, or neither Typically, Rules should be instantiated in the loadRules method of a concrete subclass of Invoker.

 o Rules
public Rules(int numConditions,
             int numRules,
             int maxNumStars,
             Algorithm alg,
             Boolean consisCheck) throws PoorPerformanceException
This version of the constructor is used if either consistency checking or a specific algorithm are to be selected. Note that there is no way to set these selections after the constructor has been invoked -- even if it could be done, it would be too late because the values for consistency checking and algorithm will have already been made.

 o Rules
public Rules(int numConditions,
             int numRules,
             int maxNumStars,
             Algorithm alg,
             Boolean consisCheck,
             boolean safetyOn) throws PoorPerformanceException
This version of the constructor is like the last one, but allows you to switch off safetyOn, which is used in the abortIfDangerous() safety check

Methods

 o addRule
public void addRule(String boolStr,
                    Action action) throws InconsistentRulesException, PoorPerformanceException, RuleNotFoundException
 o doUpdate
public void doUpdate(Hashtable ht)
This is the implementation of Updateable, used to select algorithm, set consistency checking flag, and set exception

 o getAlgorithm
public logic.Algorithm getAlgorithm()
 o getAvgNumStars
public int getAvgNumStars()
 o getConsistencyChecking
public java.lang.Boolean getConsistencyChecking()
 o getNumRules
public int getNumRules()
 o lookUp
public logic.Action lookUp(Vector results) throws PoorPerformanceException, InconsistentRulesException, RuleNotFoundException

All Packages  Class Hierarchy  This Package  Previous  Next  Index