-<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
+<html>Persons Comparator <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
--- /dev/null
+import java.awt.Color;
+
+public class Eye {
+ private Color color;
+
+ Eye(Color color) {
+ setColor(color);
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+}
--- /dev/null
+public class Firstname {
+ private String firstname;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+}
--- /dev/null
+public class Origin {
+ private String country;
+
+ Origin(String country) {
+ setCountry(country);
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+}
--- /dev/null
+import javax.swing.*;
+
+public class Person extends JPanel {
+ private Firstname firstname;
+ private Origin origin;
+ private Size size;
+ private Weight weight;
+ private Eye eye;
+
+ Person(Firstname firstname) {
+ setFirstname(firstname);
+ }
+
+ public void setFirstname(Firstname firstname) {
+ this.firstname = firstname;
+ }
+
+ public Firstname getFirstname() {
+ return firstname;
+ }
+
+ public void setOrigin(Origin origin) {
+ this.origin = origin;
+ }
+
+ public Origin getOrigin() {
+ return origin;
+ }
+
+ public void setPersonSize(Size size) {
+ this.size = size;
+ }
+
+ public Size getPersonSize() {
+ return size;
+ }
+
+ public void setWeight(Weight weight) {
+ this.weight = weight;
+ }
+
+ public Weight getWeight() {
+ return weight;
+ }
+
+ public void setEye(Eye eye) {
+ this.eye = eye;
+ }
+
+ public Eye getEye() {
+ return eye;
+ }
+}
--- /dev/null
+
+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);
+ }
+}
--- /dev/null
+public class Weight {
+ private int weight;
+
+ Weight(int weight) {
+ setWeight(weight);
+ }
+
+ public int getWeight() {
+ return weight;
+ }
+
+ public void setWeight(int weight) {
+ if (validateWeight(weight)) {
+ this.weight = weight;
+ } /* FIXME: raise an error */
+ }
+
+ private boolean validateWeight(int weight) {
+ return (weight > 0);
+ }
+}