4 private int defaultSize
= 160;
22 public int getDefaultSize() {
26 public int getSize() {
30 public void setSize(int size
) {
31 if (validateSize(size
)) {
34 throw new IllegalArgumentException("Size must be between " + this.getMin() + " and " + this.getMax());
38 private boolean validateSize(int size
) {
39 return (size
>= getMin() && size
<= getMax());
42 public int distanceTo(Size size
) {
43 int distance
= size
.getSize() - this.getSize();
44 return Math
.abs(distance
);