X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FSize.java;h=a61f24cb79769b34c3a8e8b502542621232a81ed;hb=c8da8eb79910c7ea33dc2970ebd8d1d1db234a89;hp=6946e5a8967e2358072fccd1fb7fa13e619e9f9d;hpb=62e26730c12aa80689e068908090d801869ab701;p=Persons_Comparator.git diff --git a/src/Size.java b/src/Size.java index 6946e5a..a61f24c 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,12 +26,12 @@ 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()); } } private boolean validateSize(int size) { - return (size >= min && size <= max); + return (size >= getMin() && size <= getMax()); } @Override