Class PredefinedFunction
java.lang.Object
com.yahoo.search.grouping.request.GroupingNode
com.yahoo.search.grouping.request.GroupingExpression
com.yahoo.search.grouping.request.FunctionNode
com.yahoo.search.grouping.request.PredefinedFunction
- All Implemented Interfaces:
Iterable<GroupingExpression>
- Direct Known Subclasses:
DoublePredefined
,LongPredefined
,RawPredefined
,StringPredefined
This class represents a predefined bucket-function in a
GroupingExpression
. It maps the input into one of the
given buckets by the result of the argument expression.- Author:
- Simon Thoresen Hult
-
Constructor Summary
ModifierConstructorDescriptionprotected
PredefinedFunction
(String label, Integer level, GroupingExpression exp, List<? extends BucketValue> args) -
Method Summary
Modifier and TypeMethodDescriptiongetBucket
(int i) Returns the bucket at the given index.int
Returns the number of buckets to divide the result into.Methods inherited from class com.yahoo.search.grouping.request.FunctionNode
args, asList, asList, asList, getArg, getNumArgs, iterator, resolveLevel, visit
Methods inherited from class com.yahoo.search.grouping.request.GroupingExpression
asImage, asString, copy, getLevel, getLevelOrNull, setLabel
Methods inherited from class com.yahoo.search.grouping.request.GroupingNode
getImage, getLabel, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PredefinedFunction
protected PredefinedFunction(String label, Integer level, GroupingExpression exp, List<? extends BucketValue> args)
-
-
Method Details
-
getNumBuckets
public int getNumBuckets()Returns the number of buckets to divide the result into.- Returns:
- The bucket count.
-
getBucket
Returns the bucket at the given index.- Parameters:
i
- The index of the bucket to return.- Returns:
- The bucket at the given index.
- Throws:
IndexOutOfBoundsException
- If the index is out of range.
-