Class BucketResolver
- java.lang.Object
-
- com.yahoo.search.grouping.request.BucketResolver
-
public class BucketResolver extends java.lang.Object
This is a helper class for resolving buckets to a list ofGroupingExpression
objects. To resolve a list simplypush(ConstantValue, boolean)
onto it, before callingresolve(GroupingExpression)
to retrieve the list of corresponding grouping expression object.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description BucketResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketResolver
push(ConstantValue<?> val, boolean inclusive)
Pushes the given expression onto this bucket resolver.PredefinedFunction
resolve(GroupingExpression exp)
Resolves and returns the list of grouping expressions that correspond to the previously pushed buckets.
-
-
-
Method Detail
-
push
public BucketResolver push(ConstantValue<?> val, boolean inclusive)
Pushes the given expression onto this bucket resolver. Once all buckets have been pushed using this method, callresolve(GroupingExpression)
to retrieve to combined grouping expression.- Parameters:
val
- the expression to pushinclusive
- whether or not the value is inclusive or not- Throws:
java.lang.IllegalArgumentException
- thrown if the expression is incompatible
-
resolve
public PredefinedFunction resolve(GroupingExpression exp)
Resolves and returns the list of grouping expressions that correspond to the previously pushed buckets.- Parameters:
exp
- The expression to assign to the function.- Returns:
- The list corresponding to the pushed buckets.
-
-