view
Class MyColor.ColorComparator
java.lang.Object
view.MyColor.ColorComparator
- All Implemented Interfaces:
- Comparator<Color>
- Enclosing class:
- MyColor
public static class MyColor.ColorComparator
- extends Object
- implements Comparator<Color>
A comparator class for colors. Note: this comparator imposes orderings
that are inconsistent with equals.
|
Method Summary |
int |
compare(Color o1,
Color o2)
Compare two colors by comparing their RGB integers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyColor.ColorComparator
public MyColor.ColorComparator()
compare
public int compare(Color o1,
Color o2)
- Compare two colors by comparing their RGB integers. Zero is also
returned if both objects are null. If only one parameter is null, it
is considered always less than the non-null parameter.
- Specified by:
compare in interface Comparator<Color>