Package org.apache.solr.analytics.util
Class OrdinalCalculator
- java.lang.Object
-
- org.apache.solr.analytics.util.OrdinalCalculator
-
public class OrdinalCalculator extends Object
Calculates ordinals of a comparable list by placing them in the correct positions in the list.Implements the QuickSelect algorithm, but modifies it to select multiple ordinals all at once.
-
-
Constructor Summary
Constructors Constructor Description OrdinalCalculator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Comparable<T>>
voidputOrdinalsInPosition(List<T> list, Collection<Integer> ordinals)
Calculates a set of ordinal values for a given list of comparable objects.
-
-
-
Method Detail
-
putOrdinalsInPosition
public static <T extends Comparable<T>> void putOrdinalsInPosition(List<T> list, Collection<Integer> ordinals)
Calculates a set of ordinal values for a given list of comparable objects. Once the method returns, the each ordinal is guaranteed to have the correct value in the list.- Parameters:
list
- the list ofComparable
objectsordinals
- the collection ordinals to calculate (0 to (size of list) - 1)
-
-