Class ComparisonFunction
- java.lang.Object
-
- org.apache.solr.analytics.function.mapping.ComparisonFunction
-
public class ComparisonFunction extends Object
Contains all comparable functions. Comparable functions accept two comparable (numeric and date) parameters and return a BooleanValueStream. The two parameters must be able to be cast to the same type.Uses:
- If a two comparable
AnalyticsValues are passed in, aBooleanValuerepresenting the comparison of the two values for each document is returned. - If a comparable
AnalyticsValueand a comparableAnalyticsValueStreamare passed in, aBooleanValueStreamrepresenting the comparison of the Value and each of the values of the ValueStream for the document is returned.
- If a two comparable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceComparisonFunction.CompResultFunctionstatic classComparisonFunction.GTEFunctionA comparison function that tests whether the first parameter is greater than or equal to the second parameterstatic classComparisonFunction.GTFunctionA comparison function that tests whether the first parameter is greater than the second parameterstatic classComparisonFunction.LTEFunctionA comparison function that tests whether the first parameter is less than or equal to the second parameterstatic classComparisonFunction.LTFunctionA comparison function that tests whether the first parameter is less than the second parameter
-
Constructor Summary
Constructors Constructor Description ComparisonFunction()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleanValueStreamcreateComparisonFunction(String name, ComparisonFunction.CompResultFunction comp, AnalyticsValueStream... params)Create a comparison mapping function, comparing two analytics value (streams) of the same type.
-
-
-
Method Detail
-
createComparisonFunction
public static BooleanValueStream createComparisonFunction(String name, ComparisonFunction.CompResultFunction comp, AnalyticsValueStream... params)
Create a comparison mapping function, comparing two analytics value (streams) of the same type.- Parameters:
name- name of the functioncomp- function to find the result of a comparisonparams- the parameters to compare- Returns:
- an instance of the requested comparison function using the given parameters
-
-