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 Exception
Exceptionpublic TrieBasedEvaluationEngine(RuleSystemMetaData metaData, List<Rule> rules) throws Exception
Exceptionpublic List<Rule> getAllRules()
getAllRules in interface IEvaluationEnginepublic Rule getRule(String ruleId)
getRule in interface IEvaluationEnginepublic Rule getRule(Map<String,String> inputMap) throws Exception
getRule in interface IEvaluationEngineExceptionpublic Rule getNextApplicableRule(Map<String,String> inputMap) throws Exception
getNextApplicableRule in interface IEvaluationEngineExceptionpublic void addRule(Rule rule) throws Exception
addRule in interface IEvaluationEngineExceptionpublic void deleteRule(Rule rule) throws Exception
deleteRule in interface IEvaluationEngineExceptionpublic List<Rule> getAllApplicableRules(Map<String,String> inputMap) throws Exception
getAllApplicableRules in interface IEvaluationEngineExceptionCopyright © 2020. All rights reserved.