private void displayResults() {
   if (currentResult >= 0 && currentResult < results.size()) {
     MatchResult matchResult = results.get(currentResult);
     Pair<String, String> p = DebugClauses.resultTreeToString(clauseBase, matchResult);
     txtOutput.setText(p.getFirst());
     txtConcatedResult.setText(p.getSecond());
   } else {
     txtOutput.setText("");
     txtConcatedResult.setText("");
   }
 }
  public void build(InputStream input) throws Exception {
    XmlClauseParser clauseParser = new XmlClauseParser(this);

    long startTime = System.currentTimeMillis();

    clauseParser.parse(input);

    this.dictionary = clauseParser.getLatestDictionary();

    NodeAliasList starts = new NodeAliasList(10);
    NodeAliasList ends = new NodeAliasList(10);

    int endingCounter = 0;

    List<AndClause> primaryClauses = clauseParser.getPrimaryClauses();
    for (AndClause clause : primaryClauses) {
      AliasTreeNode rootAlias = AliasTreeNode.createRoot(clause.getName());

      System.out.println("Building Clause: " + clause.getName());
      System.out.println("========================");
      clause.printClauseTree(System.out, 0);

      starts.clear();
      ends.clear();

      starts.add(matcherRoot);
      clause.buildMatchTree(rootAlias, null, starts, ends, true);
      rootAliases.add(rootAlias);

      DebugClauses.printAliasTree(rootAlias);
    }

    DebugClauses.printMatcherTree(matcherRoot);

    System.out.println("Tree Build Taken " + (System.currentTimeMillis() - startTime) + " ms");
    System.out.println("Endings Found: " + endingCounter);
    System.out.println(
        "ConstantMatcherNodes created: " + ConstantMatcherNode.constantMatcherNodeCounter);
  }