}
private void addRuleToCache(Rule rule) {
RSNode currNode = this.root;
for (int i = 0; i < this.inputColumnList.size(); i++) {
RuleInputMetaData currInput = this.inputColumnList.get(i);
// 1. See if the current node has a node mapping to the field value
List<RSNode> nodeList =
currNode.getNodes(rule.getColumnData(currInput.getName()).getValue(), false);
// 2. If it doesn't, create a new empty node and map the field value
// to the new node.
// Also move to the new node.
if (nodeList.isEmpty()) {
RSNode newNode;
if (i < this.inputColumnList.size() - 1) {
if (this.inputColumnList.get(i + 1).getDataType().equals(DataType.VALUE)) {
newNode = new ValueRSNode(this.inputColumnList.get(i + 1).getName());
} else {
newNode = new RangeRSNode(this.inputColumnList.get(i + 1).getName());
}
} else {
newNode = new ValueRSNode("");
}
currNode.addChildNode(
rule.getColumnData(currInput.getName()), newNode);
currNode = newNode;
} // 3. If it does, move to that node.
else {
currNode = nodeList.get(0);
}