view
Class MyColor.ColorComparator

java.lang.Object
  extended by 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.


Constructor Summary
MyColor.ColorComparator()
           
 
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
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

MyColor.ColorComparator

public MyColor.ColorComparator()
Method Detail

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>