/** * Calculate the number of string that will be generated until the * transaction presented by this node, and set the result in * <code>nbrMatchedString</code>. */ public void updateNbrMatchedString() { if (isNbrMatchedStringUpdated) return; if (nextNodes.size() == 0) nbrMatchedString = nbrChar; else for (Node childNode : nextNodes) { childNode.updateNbrMatchedString(); long childNbrChar = childNode.getNbrMatchedString(); nbrMatchedString += nbrChar * childNbrChar; } isNbrMatchedStringUpdated = true; }
/** * Calculate the number of string that will be generated until the * transaction presented by this node, and set the result in * <code>nbrMatchedString</code>. */ public void updateNbrMatchedString() { if (isNbrMatchedStringUpdated) return; if (nextNodes.size() == 0) nbrMatchedString = nbrChar; else for (Node childNode : nextNodes) { childNode.updateNbrMatchedString(); long childNbrChar = childNode.getNbrMatchedString(); nbrMatchedString += nbrChar * childNbrChar; } isNbrMatchedStringUpdated = true; }
/** * Prepare the rootNode and it's child nodes so that we can get matchedString by index */ private void buildRootNode() { if (isTransactionNodeBuilt) return; isTransactionNodeBuilt = true; rootNode = new Node(); rootNode.setNbrChar(1); List<Node> nextNodes = prepareTransactionNodes(automaton.getInitialState()); rootNode.setNextNodes(nextNodes); rootNode.updateNbrMatchedString(); }
/** * Prepare the rootNode and it's child nodes so that we can get matchedString by index */ private void buildRootNode() { if (isTransactionNodeBuilt) return; isTransactionNodeBuilt = true; rootNode = new Node(); rootNode.setNbrChar(1); List<Node> nextNodes = prepareTransactionNodes(automaton.getInitialState()); rootNode.setNextNodes(nextNodes); rootNode.updateNbrMatchedString(); }