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
AnalyticsValue
s are passed in, aBooleanValue
representing the comparison of the two values for each document is returned. - If a comparable
AnalyticsValue
and a comparableAnalyticsValueStream
are passed in, aBooleanValueStream
representing 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 interface
ComparisonFunction.CompResultFunction
static class
ComparisonFunction.GTEFunction
A comparison function that tests whether the first parameter is greater than or equal to the second parameterstatic class
ComparisonFunction.GTFunction
A comparison function that tests whether the first parameter is greater than the second parameterstatic class
ComparisonFunction.LTEFunction
A comparison function that tests whether the first parameter is less than or equal to the second parameterstatic class
ComparisonFunction.LTFunction
A 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 BooleanValueStream
createComparisonFunction(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
-
-