-public class Weight implements Comparable<Weight> {
+public class Weight {
private int min = 2;
- private int max = 600;
+ private int max = 250;
private int defaultWeight = 72;
private int weight;
return intArray;
}
- @Override
- public int compareTo(Weight weight) {
+ public int distanceTo(Weight weight) {
int distance = weight.getWeight() - this.getWeight();
- if (distance >= 0)
- return distance;
- else
- return -distance;
+ return Math.abs(distance);
}
}