Commit | Line | Data |
---|---|---|
1 | ||
2 | public class Size { | |
3 | private int max = 240; | |
4 | private int min = 20; | |
5 | private int size; | |
6 | ||
7 | Size(int size) { | |
8 | setSize(size); | |
9 | } | |
10 | ||
11 | public int getSize() { | |
12 | return size; | |
13 | } | |
14 | ||
15 | public void setSize(int size) { | |
16 | if (validateSize(size)) { | |
17 | this.size = size; | |
18 | } /* FIXME: raise an error */ | |
19 | } | |
20 | ||
21 | private boolean validateSize(int size) { | |
22 | return (size > max || size < min); | |
23 | } | |
24 | } |