1 package cz.cuni.amis.pogamut.defcon.consts;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6
7
8
9
10
11
12
13 public enum CityPopulations {
14
15 DEFAULT(0),
16 EQUALISED(1),
17 RANDOM(2),
18 TOTALLY_RANDOM(3);
19
20 private static Map<Integer, CityPopulations> enums = new HashMap<Integer, CityPopulations>();
21
22 public static CityPopulations getEnum(int id) {
23 return enums.get(id);
24 }
25
26 static {
27 for (CityPopulations item : CityPopulations.values()) {
28 enums.put(item.id, item);
29 }
30 }
31
32 public final int id;
33
34 private CityPopulations(int id) {
35 this.id = id;
36 }
37
38 }