Browse Source

Merge pull request #1017 from sjwarner-bp/anagram-reference-update

anagram: improve reference solution
FridaTveit 8 years ago
parent
commit
fbd4047388
No account linked to committer's email
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      exercises/anagram/.meta/src/reference/java/Anagram.java

+ 5
- 5
exercises/anagram/.meta/src/reference/java/Anagram.java View File

@@ -1,14 +1,14 @@
1 1
 import java.util.*;
2 2
 
3
-public class Anagram {
3
+class Anagram {
4 4
 
5 5
     private final AnagramSubject anagramSubject;
6 6
 
7
-    public Anagram(String word) {
7
+    Anagram(String word) {
8 8
         anagramSubject = new AnagramSubject(word);
9 9
     }
10 10
 
11
-    public List<String> match(List<String> candidates) {
11
+    List<String> match(List<String> candidates) {
12 12
         List<String> anagrams = new ArrayList<String>();
13 13
 
14 14
         for (String candidate : candidates) {
@@ -25,12 +25,12 @@ public class Anagram {
25 25
         private final String word;
26 26
         private final char[] fingerprint;
27 27
 
28
-        public AnagramSubject(String other) {
28
+        AnagramSubject(String other) {
29 29
             this.word = other;
30 30
             this.fingerprint = canonicalize(other);
31 31
         }
32 32
 
33
-        public boolean anagramOf(String other) {
33
+        boolean anagramOf(String other) {
34 34
             return !duplicate(other) && Arrays.equals(fingerprint,canonicalize(other));
35 35
         }
36 36