Class FacetResultsComparator
- java.lang.Object
-
- org.apache.solr.analytics.facet.compare.FacetResultsComparator
-
- All Implemented Interfaces:
Comparator<SortableFacet.FacetBucket>
- Direct Known Subclasses:
ConstantComparator
,DelegatingComparator
,ExpressionComparator
,FacetValueComparator
public abstract class FacetResultsComparator extends Object implements Comparator<SortableFacet.FacetBucket>
A comparator used to sort the buckets of facet.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
resultMult
-
Constructor Summary
Constructors Constructor Description FacetResultsComparator()
Create a results comparator assuming an ascending ordering.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
compare(SortableFacet.FacetBucket b1, SortableFacet.FacetBucket b2)
Compare one facet bucket to another.void
setDirection(boolean ascending)
Set the order direction for comparison.-
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
-
-
-
-
Method Detail
-
setDirection
public void setDirection(boolean ascending)
Set the order direction for comparison.- Parameters:
ascending
- whether to compare using an ascending ordering
-
compare
public abstract int compare(SortableFacet.FacetBucket b1, SortableFacet.FacetBucket b2)
Compare one facet bucket to another.- Specified by:
compare
in interfaceComparator<SortableFacet.FacetBucket>
- Parameters:
b1
- the first bucket to compareb2
- the second bucket to compare
-
-