import java.awt.Color;
+import java.util.List;
-public class Eye {
+public class Eye implements Comparable<Eye> {
private Color color;
+ private List<Color> colorList;
- Eye(Color color) {
+ Eye(String color) {
setColor(color);
}
return color;
}
- public void setColor(Color color) {
- this.color = color;
+ public void setColor(String color) {
+ this.color = Color.getColor(color);
+ }
+
+ @Override
+ public int compareTo(Eye eye) {
+ return 0;
}
}
-public class Firstname {
+public class Firstname implements Comparable<Firstname> {
private String firstname;
public String getFirstname() {
public void setFirstname(String firstname) {
this.firstname = firstname;
}
+
+ @Override
+ public int compareTo(Firstname firstname) {
+ return 0;
+ }
}
-public class Origin {
+public class Origin implements Comparable<Origin> {
private String country;
Origin(String country) {
public void setCountry(String country) {
this.country = country;
}
+
+ @Override
+ public int compareTo(Origin origin) {
+ return 0;
+ }
}
import javax.swing.*;
-public class Person extends JPanel {
+public class Person extends JPanel implements Comparable<Person> {
private Firstname firstname;
private Origin origin;
private Size size;
public Eye getEye() {
return eye;
}
+
+ @Override
+ public int compareTo(Person person) {
+ return 0;
+ }
}
+import java.util.Comparator;
-public class Size {
+public class Size implements Comparable<Size> {
private int max = 240;
private int min = 20;
private int size;
private boolean validateSize(int size) {
return (size > max || size < min);
}
+
+ @Override
+ public int compareTo(Size size) {
+ return 0;
+ }
}
-public class Weight {
+public class Weight implements Comparable<Weight> {
private int weight;
Weight(int weight) {
private boolean validateWeight(int weight) {
return (weight > 0);
}
+
+ @Override
+ public int compareTo(Weight weight) {
+ return 0;
+ }
}