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
49
50
51
52
53
54
55
| import java.util.HashMap;
import java.util.Map;
/**
*
* @author stavros
*/
public enum MorseCode {
DIT,
DAH;
public static Map<String,MorseCode[]> getMap() {
Map<String, MorseCode[]> map = new HashMap<>();
map.put("A", new MorseCode[]{DIT, DAH});
map.put("B", new MorseCode[]{DAH, DIT, DIT, DIT});
map.put("C", new MorseCode[]{DAH, DIT, DAH, DIT});
map.put("D", new MorseCode[]{DAH, DIT, DIT});
map.put("E", new MorseCode[]{DIT});
map.put("F", new MorseCode[]{DIT, DIT, DAH, DIT});
map.put("G", new MorseCode[]{DAH, DAH, DIT});
map.put("H", new MorseCode[]{DIT, DIT, DIT, DIT});
map.put("I", new MorseCode[]{DIT, DIT});
map.put("J", new MorseCode[]{DIT, DAH, DAH, DAH});
map.put("K", new MorseCode[]{DAH, DIT, DAH});
map.put("L", new MorseCode[]{DIT, DAH, DIT, DIT});
map.put("M", new MorseCode[]{DAH, DAH});
map.put("N", new MorseCode[]{DAH, DIT});
map.put("O", new MorseCode[]{DAH, DAH, DAH});
map.put("P", new MorseCode[]{DIT, DAH, DAH, DIT});
map.put("Q", new MorseCode[]{DAH, DAH, DIT, DAH});
map.put("R", new MorseCode[]{DIT, DAH, DIT});
map.put("S", new MorseCode[]{DIT, DIT, DIT});
map.put("T", new MorseCode[]{DAH});
map.put("U", new MorseCode[]{DIT, DIT, DAH});
map.put("V", new MorseCode[]{DIT, DIT, DIT, DAH});
map.put("W", new MorseCode[]{DIT, DAH, DAH});
map.put("X", new MorseCode[]{DAH, DIT, DIT, DAH});
map.put("Y", new MorseCode[]{DAH, DIT, DAH, DAH});
map.put("Z", new MorseCode[]{DAH, DAH, DIT, DIT});
map.put("0", new MorseCode[]{DAH, DAH, DAH, DAH, DAH});
map.put("1", new MorseCode[]{DIT, DAH, DAH, DAH, DAH});
map.put("2", new MorseCode[]{DIT, DIT, DAH, DAH, DAH});
map.put("3", new MorseCode[]{DIT, DIT, DIT, DAH, DAH});
map.put("4", new MorseCode[]{DIT, DIT, DIT, DIT, DAH});
map.put("5", new MorseCode[]{DIT, DIT, DIT, DIT, DIT});
map.put("6", new MorseCode[]{DAH, DIT, DIT, DIT, DIT});
map.put("7", new MorseCode[]{DAH, DAH, DIT, DIT, DIT});
map.put("8", new MorseCode[]{DAH, DAH, DAH, DIT, DIT});
map.put("9", new MorseCode[]{DAH, DAH, DAH, DAH, DIT});
return map;
}
}
|