blob: b7c1a61d927d7b4befa2823d00794d1cf9d85e23 (
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(
"C:/eclipse/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.");
}
}
|