summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java
blob: 6d9b12cb5d7bf27e8ad5c21281c4233a4b0a21ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
 * 
 */
package de.fhswf.in.inf.java1.aufgabe10;

import java.io.File;

/**
 * Tests the ParallelWordCount class.
 *
 * @author $Author: $
 * @version $Revision: $, $Date: $ UTC
 */
public final class WordCountTest
{

   /**
    * Private constructor for utility class.
    *
    */
   private WordCountTest()
   {
   }

   /**
    * Tests the ParallelWordCount class.
    *
    * @param args
    *           Command line arguments.
    */
   public static void main(String[] args)
   {
      File file = new File(
            "/home/aentfs/workspace/Java1/misc/Blatt9TestFile2.txt");

      ParallelWordCount tmp = new ParallelWordCount();
      tmp.readFile(file);
      for (String word : tmp.getWords())
      {
         System.out.println("Wort \"" + word + "\" kommt "
               + tmp.getCount(word) + " mal vor.");
      }
      System.out.println("Wort \"fgh\" kommt "
            + tmp.getCount("fgh") + " mal vor.");

   }

}