summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2014-12-07 21:21:51 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2014-12-07 21:21:51 +0100
commitcfd8642679d1d105a275d793f7049b4a24fda4b7 (patch)
tree315498bcce7564992bb7a74ea4bc9f8c0bbabbd4 /src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java
parent9acea903216dbe371dd7b41cbf23b46a5732bcb4 (diff)
downloadJava1-cfd8642679d1d105a275d793f7049b4a24fda4b7.tar.gz
Java1-cfd8642679d1d105a275d793f7049b4a24fda4b7.zip
Assignment No.10 implements classes.
Diffstat (limited to 'src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java')
-rw-r--r--src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java b/src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java
new file mode 100644
index 0000000..6d9b12c
--- /dev/null
+++ b/src/de/fhswf/in/inf/java1/aufgabe10/WordCountTest.java
@@ -0,0 +1,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.");
+
+ }
+
+}