Basic classes structure that deal with Person attributes.
[Persons_Comparator.git] / src / Size.java
diff --git a/src/Size.java b/src/Size.java
new file mode 100644 (file)
index 0000000..0cecada
--- /dev/null
@@ -0,0 +1,24 @@
+
+public class Size {
+    private int max = 240;
+    private int min = 20;
+    private int size;
+
+    Size(int size) {
+        setSize(size);
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public void setSize(int size) {
+        if (validateSize(size)) {
+            this.size = size;
+        } /* FIXME: raise an error */
+    }
+
+    private boolean validateSize(int size) {
+        return (size > max || size < min);
+    }
+}