Class SameSizeKMeans.PreferenceComparator

  • All Implemented Interfaces:
    it.unimi.dsi.fastutil.ints.IntComparator, java.util.Comparator<java.lang.Integer>
    Enclosing class:
    SameSizeKMeans<V extends NumberVector>

    public static class SameSizeKMeans.PreferenceComparator
    extends java.lang.Object
    implements it.unimi.dsi.fastutil.ints.IntComparator
    Sort a list of integers (= cluster numbers) by the distances.
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) SameSizeKMeans.Meta c
      Meta to use for comparison.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(int o1, int o2)  
      it.unimi.dsi.fastutil.ints.IntComparator select​(SameSizeKMeans.Meta c)
      Set the meta to sort by
      • 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, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
      • Methods inherited from interface it.unimi.dsi.fastutil.ints.IntComparator

        compare, reversed, thenComparing, thenComparing
    • Constructor Detail

      • PreferenceComparator

        public PreferenceComparator()
    • Method Detail

      • compare

        public int compare​(int o1,
                           int o2)
        Specified by:
        compare in interface it.unimi.dsi.fastutil.ints.IntComparator
      • select

        public it.unimi.dsi.fastutil.ints.IntComparator select​(SameSizeKMeans.Meta c)
        Set the meta to sort by
        Parameters:
        c - Meta to sort by
        Returns:
        The comparator