Class BucketResolver

java.lang.Object
com.yahoo.search.grouping.request.BucketResolver

public class BucketResolver extends Object
This is a helper class for resolving buckets to a list of GroupingExpression objects. To resolve a list simply push(ConstantValue, boolean) onto it, before calling resolve(GroupingExpression) to retrieve the list of corresponding grouping expression object.
Author:
Simon Thoresen Hult
  • Constructor Details

    • BucketResolver

      public BucketResolver()
  • Method Details

    • 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, call resolve(GroupingExpression) to retrieve to combined grouping expression.
      Parameters:
      val - the expression to push
      inclusive - whether or not the value is inclusive or not
      Throws:
      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.