X-Git-Url: https://git.piment-noir.org/?p=Persons_Comparator.git;a=blobdiff_plain;f=src%2FEye.java;h=822e6f83dd3fc7aabc5bcf5d864671c828c6f999;hp=edaea1bb467c07f00a510e155804a25c7b952114;hb=5687dc10a68b52d28b63151d8c16a45775ef2e77;hpb=9b3bfcdd95253a04ed12a676ee29a9d777c1e496 diff --git a/src/Eye.java b/src/Eye.java index edaea1b..822e6f8 100644 --- a/src/Eye.java +++ b/src/Eye.java @@ -1,7 +1,7 @@ import java.awt.Color; import java.util.Arrays; -public class Eye implements Comparable { +public class Eye { private String strColor; private Color color; private String[] colorsList = {"black", "blue", "brown", "green"}; @@ -81,8 +81,7 @@ public class Eye implements Comparable { * @param eye * @return */ - @Override - public int compareTo(Eye eye) { + public int distanceTo(Eye eye) { double r_diff = this.getColor().getRed() - eye.getColor().getRed(); double g_diff = this.getColor().getGreen() - eye.getColor().getGreen(); double b_diff = this.getColor().getBlue() - eye.getColor().getBlue();