X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FWeight.java;h=e79d1025a9e35977344ab5003e129df1aa88ff03;hb=613054ac3144a04ab284e159b610317eacf67e1f;hp=b0264faa591187841e4345f0a94b00e0d9347f63;hpb=1c1189337121a1baa74961813e619c99b398a333;p=Persons_Comparator.git diff --git a/src/Weight.java b/src/Weight.java index b0264fa..e79d102 100644 --- a/src/Weight.java +++ b/src/Weight.java @@ -23,6 +23,10 @@ public class Weight implements Comparable { @Override public int compareTo(Weight weight) { - return 0; + int distance = weight.weight - this.getWeight(); + if (distance >= 0) + return distance; + else + return -distance; } }