Package com.jalios.jcms
Class Publication.RelatedCategoryComparator<T extends Publication>
- java.lang.Object
-
- com.jalios.jstore.BasicStorable.CdateComparator<T>
-
- com.jalios.jcms.Publication.PdateComparator<T>
-
- com.jalios.jcms.Publication.RelatedCategoryComparator<T>
-
- Type Parameters:
T
- a type of Publication
- All Implemented Interfaces:
java.util.Comparator<T>
- Enclosing class:
- Publication
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.- Since:
- jcms-10.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Category>
catSet
protected java.util.Comparator<T>
superComparator
-
Constructor Summary
Constructors Constructor Description RelatedCategoryComparator(java.util.Set<Category> catSet)
RelatedCategoryComparator(java.util.Set<Category> catSet, 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 com.jalios.jstore.BasicStorable.CdateComparator
compareDate
-
-
-
-
Field Detail
-
catSet
protected java.util.Set<Category> catSet
-
superComparator
protected java.util.Comparator<T extends Publication> superComparator
-
-
Method Detail
-
compare
public int compare(T p1, T p2)
- Specified by:
compare
in interfacejava.util.Comparator<T extends Publication>
- Overrides:
compare
in classPublication.PdateComparator<T extends Publication>
-
-