X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FSize.java;h=a0e7d780900685c817fd46e26a46ffb5303614c5;hb=476910abd64760223f3e4143866134e49facf487;hp=e665140b9f83c020a1f23ea1dc973ea45ccdbd22;hpb=b974e749af3a4b2df3737b2d361233c704dcc4d8;p=Persons_Comparator.git diff --git a/src/Size.java b/src/Size.java index e665140..a0e7d78 100644 --- a/src/Size.java +++ b/src/Size.java @@ -1,6 +1,6 @@ public class Size implements Comparable { private int max = 240; - private int min = 20; + private int min = 40; private int size; Size() { @@ -10,6 +10,14 @@ public class Size implements Comparable { setSize(size); } + public int getMin() { + return min; + } + + public int getMax() { + return max; + } + public int getSize() { return size; } @@ -18,7 +26,7 @@ public class Size implements Comparable { if (validateSize(size)) { this.size = size; } else { - throw new IllegalArgumentException("Size must be between " + this.min + " and " + this.max); + throw new IllegalArgumentException("Size must be between " + this.getMin() + " and " + this.getMax()); } } @@ -28,7 +36,7 @@ public class Size implements Comparable { @Override public int compareTo(Size size) { - int distance = size.size - this.getSize(); + int distance = size.getSize() - this.getSize(); if (distance >= 0) return distance; else