repositories
/
Persons_Comparator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refine the weight max and its drawing.
[Persons_Comparator.git]
/
src
/
Weight.java
diff --git
a/src/Weight.java
b/src/Weight.java
index 4b67611af0eef2f07bfa7437e498d9418298af7c..c979f3ddcab3911914e519b71075d4023fe0507a 100644
(file)
--- a/
src/Weight.java
+++ b/
src/Weight.java
@@
-1,6
+1,6
@@
-public class Weight
implements Comparable<Weight>
{
+public class Weight {
private int min = 2;
private int min = 2;
- private int max =
60
0;
+ private int max =
25
0;
private int defaultWeight = 72;
private int weight;
private int defaultWeight = 72;
private int weight;
@@
-48,12
+48,8
@@
public class Weight implements Comparable<Weight> {
return intArray;
}
return intArray;
}
- @Override
- public int compareTo(Weight weight) {
+ public int distanceTo(Weight weight) {
int distance = weight.getWeight() - this.getWeight();
int distance = weight.getWeight() - this.getWeight();
- if (distance >= 0)
- return distance;
- else
- return -distance;
+ return Math.abs(distance);
}
}
}
}