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(..)
-
MAX_NUMBER_CONDITIONS
-
-
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.
-
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.
-
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
-
addRule(String, Action)
-
-
doUpdate(Hashtable)
- This is the implementation of Updateable, used to select algorithm,
set consistency checking flag, and set exception
-
getAlgorithm()
-
-
getAvgNumStars()
-
-
getConsistencyChecking()
-
-
getNumRules()
-
-
lookUp(Vector)
-
MAX_NUMBER_CONDITIONS
public static final int MAX_NUMBER_CONDITIONS
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.
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.
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
addRule
public void addRule(String boolStr,
Action action) throws InconsistentRulesException, PoorPerformanceException, RuleNotFoundException
doUpdate
public void doUpdate(Hashtable ht)
- This is the implementation of Updateable, used to select algorithm,
set consistency checking flag, and set exception
getAlgorithm
public logic.Algorithm getAlgorithm()
getAvgNumStars
public int getAvgNumStars()
getConsistencyChecking
public java.lang.Boolean getConsistencyChecking()
getNumRules
public int getNumRules()
lookUp
public logic.Action lookUp(Vector results) throws PoorPerformanceException, InconsistentRulesException, RuleNotFoundException
All Packages Class Hierarchy This Package Previous Next Index