repositories
/
Persons_Comparator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start the implementation of inputs gathering and the comparator code (still buggy...
[Persons_Comparator.git]
/
src
/
Eye.java
diff --git
a/src/Eye.java
b/src/Eye.java
index 6b71f354d6cd9e3d8a7bb043680efda045a1b573..edaea1bb467c07f00a510e155804a25c7b952114 100644
(file)
--- a/
src/Eye.java
+++ b/
src/Eye.java
@@
-27,7
+27,7
@@
public class Eye implements Comparable<Eye> {
if (validateColor(strColor)) {
this.strColor = strColor;
} else {
if (validateColor(strColor)) {
this.strColor = strColor;
} else {
- throw new IllegalArgumentException("Color must be" +
new Eye()
.colorListToString());
+ throw new IllegalArgumentException("Color must be" +
this
.colorListToString());
}
}
}
}
@@
-47,13
+47,16
@@
public class Eye implements Comparable<Eye> {
*/
public void setColor(String color) {
if (validateColor(color)) {
*/
public void setColor(String color) {
if (validateColor(color)) {
- if (color.equals("brown"))
+ if (color.equals("black"))
+ this.color = Color.black;
+ else if (color.equals("blue"))
+ this.color = Color.blue;
+ else if (color.equals("brown"))
this.color = new Color(88, 41, 0);
this.color = new Color(88, 41, 0);
- else
- this.color = Color.getColor(color);
-
+ else if (color.equals("green"))
+ this.color = Color.green;
} else {
} else {
- throw new IllegalArgumentException("Color must be" +
new Eye()
.colorListToString());
+ throw new IllegalArgumentException("Color must be" +
this
.colorListToString());
}
}
}
}