Class RGBColorComparator
- java.lang.Object
-
- net.sourceforge.jiu.color.quantization.RGBColorComparator
-
- All Implemented Interfaces:
RGBIndex,ComparatorInterface
public class RGBColorComparator extends Object implements ComparatorInterface, RGBIndex
Compares twoRGBColorobjects.- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private intsortOrder-
Fields inherited from interface net.sourceforge.jiu.data.RGBIndex
INDEX_BLUE, INDEX_GREEN, INDEX_RED
-
-
Constructor Summary
Constructors Constructor Description RGBColorComparator(int aSortOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Object o1, Object o2)Compares the two argument objects and returns their relation.voidsetSortOrder(int aSortOrder)Sets the internal sort order (it is sorted by one of the three RGB components) to the parameter.
-
-
-
Method Detail
-
compare
public int compare(Object o1, Object o2)
Description copied from interface:ComparatorInterfaceCompares the two argument objects and returns their relation. Returns- a value < 0 if
o1is smaller thano2, - 0 if
o1is equal too2and - a value > 0 if
o1is greater thano2.
- Specified by:
comparein interfaceComparatorInterface
- a value < 0 if
-
setSortOrder
public void setSortOrder(int aSortOrder)
Sets the internal sort order (it is sorted by one of the three RGB components) to the parameter.
-
-