Class ColorCountComparator
- java.lang.Object
-
- org.apache.commons.imaging.palette.ColorCountComparator
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Comparator<ColorCount>
public class ColorCountComparator extends java.lang.Object implements java.util.Comparator<ColorCount>, java.io.Serializable
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.REDchannel, then it will compare the value of red of eachColorCountobject in the array of elements.- Since:
- 1.0-alpha2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ColorComponentcolorComponentColor component used during the comparison.private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ColorCountComparator(ColorComponent colorComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(ColorCount c1, ColorCount c2)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
colorComponent
private ColorComponent colorComponent
Color component used during the comparison.
-
-
Constructor Detail
-
ColorCountComparator
public ColorCountComparator(ColorComponent colorComponent)
-
-
Method Detail
-
compare
public int compare(ColorCount c1, ColorCount c2)
- Specified by:
comparein interfacejava.util.Comparator<ColorCount>
-
-