Class RGBColorComparator
java.lang.Object
net.sourceforge.jiu.color.quantization.RGBColorComparator
- All Implemented Interfaces:
RGBIndex
,ComparatorInterface
Compares two
RGBColor
objects.- Author:
- Marco Schmidt
-
Field Summary
FieldsFields inherited from interface net.sourceforge.jiu.data.RGBIndex
INDEX_BLUE, INDEX_GREEN, INDEX_RED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compares the two argument objects and returns their relation.void
setSortOrder
(int aSortOrder) Sets the internal sort order (it is sorted by one of the three RGB components) to the parameter.
-
Field Details
-
sortOrder
private int sortOrder
-
-
Constructor Details
-
RGBColorComparator
public RGBColorComparator(int aSortOrder)
-
-
Method Details
-
compare
Description copied from interface:ComparatorInterface
Compares the two argument objects and returns their relation. Returns- a value < 0 if
o1
is smaller thano2
, - 0 if
o1
is equal too2
and - a value > 0 if
o1
is greater thano2
.
- Specified by:
compare
in 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.
-