for (int i = 0; i < nodes.size(); i++) {
newNodes.addAll(traverse(nodes.get(i), context, trieNodes,
negated));
}
} else if (node instanceof RepeatNode) {
RepeatNode repeatNode = (RepeatNode) node;
TrieNode<V> tempNode = new TrieNode<V>();
List<TrieNode<V>> tempNodeList = new ArrayList<TrieNode<V>>(1);
tempNodeList.add(tempNode);
newNodes = traverse(repeatNode.getDecorated(), context,
tempNodeList, negated);
if (repeatNode.getMax() != Integer.MAX_VALUE) {
List<TrieNode<V>> tempNodes = newNodes;
newNodes = new ArrayList<TrieNode<V>>();
for (int i = 1; i < repeatNode.getMax(); i++) {
tempNodes = traverse(repeatNode.getDecorated(), context,
tempNodes, negated);
if (i + 1 >= repeatNode.getMin()) {
newNodes.addAll(tempNodes);
}
}
} else if (repeatNode.getMin() != 0) {
List<TrieNode<V>> tempNodes = newNodes;
newNodes = new ArrayList<TrieNode<V>>();
for (int i = 1; i < repeatNode.getMin() - 1; i++) {
tempNodes = traverse(repeatNode.getDecorated(), context,
tempNodes, negated);
}
if (repeatNode.getMin() != 1) {
TrieNode<V> minFulfilledNode = new TrieNode<V>();
List<TrieNode<V>> minFulfilledNodeList = new ArrayList<TrieNode<V>>(
1);
minFulfilledNodeList.add(minFulfilledNode);
newNodes = traverse(repeatNode.getDecorated(), context,
minFulfilledNodeList, negated);
mergeIntoNodes(tempNodes, minFulfilledNode);
mergeIntoNodes(newNodes, minFulfilledNode);
} else {
newNodes = tempNodes;
mergeIntoNodes(newNodes, tempNode);
}
} else {
mergeIntoNodes(newNodes, tempNode);
}
mergeIntoNodes(trieNodes, tempNode);
if (repeatNode.getMin() == 0) {
newNodes.addAll(trieNodes);
}
} else if (node instanceof OptionalNode) {
newNodes = traverse(((OptionalNode) node).getDecorated(), context,
trieNodes, negated);