1 package adt.tournament;
2
3 /**
4 * @author Sebastian Kuerten (sebastian.kuerten@fu-berlin.de)
5 *
6 */
7 public class Element implements Comparable<Element>
8 {
9 int value;
10
11 public Element(int value)
12 {
13 this.value = value;
14 }
15
16 void setValue(int value)
17 {
18 this.value = value;
19 }
20
21 @Override
22 public int compareTo(Element other)
23 {
24 return value - other.value;
25 }
26
27 @Override
28 public boolean equals(Object other)
29 {
30 if (!(other instanceof Element)) {
31 return false;
32 }
33 Element otherElement = (Element) other;
34 return value == otherElement.value;
35 }
36
37 @Override
38 public String toString()
39 {
40 return "" + value;
41 }
42 }