Class ColorCountComparator
java.lang.Object
org.apache.commons.imaging.palette.ColorCountComparator
- All Implemented Interfaces:
Comparator<ColorCount>
A comparator for {#link ColorCount} elements.
It uses a given {#link ColorComponent} to choose what channel must be used for the comparison.
For example, if the comparator is created for the ColorComponent.RED channel, then it will compare the value of red of each ColorCount object
in the array of elements.
- Since:
- 1.0-alpha2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ColorComponentColor component used during the comparison. -
Constructor Summary
ConstructorsConstructorDescriptionColorCountComparator(ColorComponent colorComponent) Constructs a new instance. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
colorComponent
Color component used during the comparison.
-
-
Constructor Details
-
ColorCountComparator
Constructs a new instance.- Parameters:
colorComponent- Color component to wrap.
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<ColorCount>
-