git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard accelerators
[fanfix.git]
/
src
/
jexer
/
bits
/
Color.java
diff --git
a/src/jexer/bits/Color.java
b/src/jexer/bits/Color.java
index 707b244b12664aa04a2c691cb73cfa3973d06e27..54ae66aeaf0d54fac263e1e3445bfa47dc50ef9c 100644
(file)
--- a/
src/jexer/bits/Color.java
+++ b/
src/jexer/bits/Color.java
@@
-215,6
+215,16
@@
public final class Color {
return (value == that.value);
}
return (value == that.value);
}
+ /**
+ * Hashcode uses all fields in equals().
+ *
+ * @return the hash
+ */
+ @Override
+ public int hashCode() {
+ return value;
+ }
+
/**
* Make human-readable description of this Color.
*
/**
* Make human-readable description of this Color.
*
@@
-239,8
+249,9
@@
public final class Color {
return "blue";
case SGRYELLOW:
return "yellow";
return "blue";
case SGRYELLOW:
return "yellow";
+ default:
+ throw new IllegalArgumentException("Invalid Color value: " + value);
}
}
- throw new IllegalArgumentException("Invalid Color value: " + value);
}
}
}
}