|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
import java.util.Map;
|
|
2
|
2
|
import java.util.HashMap;
|
|
3
|
3
|
|
|
4
|
|
-public class Scrabble {
|
|
|
4
|
+final class Scrabble {
|
|
5
|
5
|
|
|
6
|
6
|
private String word;
|
|
7
|
7
|
|
|
|
@@ -36,17 +36,15 @@ public class Scrabble {
|
|
36
|
36
|
letterScores.put('z', 10);
|
|
37
|
37
|
}
|
|
38
|
38
|
|
|
39
|
|
- private Object score;
|
|
40
|
|
-
|
|
41
|
|
- public Scrabble(String word) {
|
|
|
39
|
+ Scrabble(String word) {
|
|
42
|
40
|
this.word = word;
|
|
43
|
41
|
}
|
|
44
|
42
|
|
|
45
|
|
- public int getScore() {
|
|
|
43
|
+ int getScore() {
|
|
46
|
44
|
return getScore(word);
|
|
47
|
45
|
}
|
|
48
|
46
|
|
|
49
|
|
- public static int getScore(String input) {
|
|
|
47
|
+ private static int getScore(String input) {
|
|
50
|
48
|
if (input == null || input.trim().isEmpty()) {
|
|
51
|
49
|
return 0;
|
|
52
|
50
|
}
|
|
|
@@ -59,4 +57,5 @@ public class Scrabble {
|
|
59
|
57
|
|
|
60
|
58
|
return score;
|
|
61
|
59
|
}
|
|
|
60
|
+
|
|
62
|
61
|
}
|