public class TrieBasedEvaluationEngine extends Object implements IEvaluationEngine
IEvaluationEngine interface uses a Trie to store and
locate rules efficiently. The higher priority inputs constitute the top level nodes and
lower priority nodes are set as child nodes. The actual rule output value is found at the
leaf nodes.| Constructor and Description |
|---|
TrieBasedEvaluationEngine(RuleSystemMetaData metaData) |
TrieBasedEvaluationEngine(RuleSystemMetaData metaData,
List<Rule> rules) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(Rule rule) |
void |
deleteRule(Rule rule) |
List<Rule> |
getAllApplicableRules(Map<String,String> inputMap) |
List<Rule> |
getAllRules() |
Rule |
getNextApplicableRule(Map<String,String> inputMap) |
Rule |
getRule(Map<String,String> inputMap) |
Rule |
getRule(String ruleId) |
public TrieBasedEvaluationEngine(RuleSystemMetaData metaData) throws RuleConflictException
RuleConflictExceptionpublic TrieBasedEvaluationEngine(RuleSystemMetaData metaData, List<Rule> rules) throws RuleConflictException
RuleConflictExceptionpublic List<Rule> getAllRules()
getAllRules in interface IEvaluationEnginepublic Rule getRule(String ruleId)
getRule in interface IEvaluationEnginepublic Rule getRule(Map<String,String> inputMap)
getRule in interface IEvaluationEnginepublic Rule getNextApplicableRule(Map<String,String> inputMap)
getNextApplicableRule in interface IEvaluationEnginepublic void addRule(Rule rule) throws RuleConflictException
addRule in interface IEvaluationEngineRuleConflictExceptionpublic void deleteRule(Rule rule)
deleteRule in interface IEvaluationEnginepublic List<Rule> getAllApplicableRules(Map<String,String> inputMap)
getAllApplicableRules in interface IEvaluationEngineCopyright © 2020. All rights reserved.