/** * Print the results. */ public SearchResults print() { if (!isEmpty()) System.out.println(toString()); return this; } }
/** * Test PhraseMatchTask. */ @Test public void test() { // Create a tokenizer for the input. StringTokenizer tokenizer = new StringTokenizer(sINPUT_DATA, " "); // Conduct a sequential and parallel search for each entry in // the input. while (tokenizer.hasMoreElements()) { String nextWord = tokenizer.nextToken(); // Conduct a parallel search. SearchResults r1 = searchForPhrase(nextWord, sINPUT_DATA); // Get the results as strings. String parallelResult = r1.toString(); // Make sure the results are correct. assertNotEquals(0, r1.getResultList().size()); // Print the results. System.out.println (parallelResult + ": parallel"); } } }