1 package de.jos.game.xml;
2
3 import java.io.Serializable;
4 import java.util.Comparator;
5
6 public class Combination {
7
8 private Integer levelId = null;
9
10 private Integer color = null;
11 private Colors colors = null;
12 private Action action = null;
13
14 /***
15 * Comparator fuer die Combination Instanzen
16 *
17 * @author root
18 *
19 */
20 public static final class CombinationComparator implements Comparator<Combination>, Serializable {
21
22 public int compare(Combination combination1, Combination combination2) {
23 return combination1.getLevelId().compareTo(combination2.getLevelId());
24 }
25
26 }
27
28 public static final CombinationComparator COMBINATION_COMPARATOR = new CombinationComparator();
29
30 public int compareTo(Object obj) {
31 if (obj == null) {
32 return -1;
33 }
34 Combination castOther = (Combination) obj;
35 return getLevelId().compareTo(castOther.getLevelId());
36 }
37
38 public Action getAction() {
39 return action;
40 }
41
42 public void setAction(Action action) {
43 this.action = action;
44 }
45
46 public Colors getColors() {
47 return colors;
48 }
49
50 public void setColors(Colors colors) {
51 this.colors = colors;
52 }
53
54 public Integer getColor() {
55 return color;
56 }
57
58 public void setColor(Integer color) {
59 this.color = color;
60 }
61
62 public Integer getLevelId() {
63 return levelId;
64 }
65
66 public void setLevelId(Integer levelId) {
67 this.levelId = levelId;
68 }
69
70 }