Class 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.RED channel, then it will compare the value of red of each ColorCount object in the array of elements.

    Since:
    1.0-alpha2
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(ColorCount c1, ColorCount c2)  
      • 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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • colorComponent

        private ColorComponent colorComponent
        Color component used during the comparison.
    • Constructor Detail

      • ColorCountComparator

        public ColorCountComparator​(ColorComponent colorComponent)