Class Publication.RelatedCategoryComparator<T extends Publication>

  • Type Parameters:
    T - a type of Publication
    All Implemented Interfaces:
    Enclosing class:

    public static class Publication.RelatedCategoryComparator<T extends Publication>
    extends Publication.PdateComparator<T>
    Publication are sorted according the count of common categories with the given category set. In case of equality, a custom super comparator can be provided.
    • Field Summary

      Modifier and Type Field Description
      protected java.util.Set<Category> catSet  
      protected java.util.Comparator<T> superComparator  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(T p1, T p2)  
      • 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

      • catSet

        protected java.util.Set<Category> catSet
      • superComparator

        protected java.util.Comparator<T extends Publication> superComparator
    • Constructor Detail

      • RelatedCategoryComparator

        public RelatedCategoryComparator​(java.util.Set<Category> catSet)
      • RelatedCategoryComparator

        public RelatedCategoryComparator​(java.util.Set<Category> catSet,
                                         java.util.Comparator<T> superComparator)