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:
java.lang.Iterable<GroupingExpression>
- Direct Known Subclasses:
DoublePredefined
,LongPredefined
,RawPredefined
,StringPredefined
public abstract class PredefinedFunction extends FunctionNode
This class represents a predefined bucket-function in aGroupingExpression
. It maps the input into one of the given buckets by the result of the argument expression.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PredefinedFunction(java.lang.String label, java.lang.Integer level, GroupingExpression exp, java.util.List<? extends BucketValue> args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketValue
getBucket(int i)
Returns the bucket at the given index.int
getNumBuckets()
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
-
-
-
-
Constructor Detail
-
PredefinedFunction
protected PredefinedFunction(java.lang.String label, java.lang.Integer level, GroupingExpression exp, java.util.List<? extends BucketValue> args)
-
-
Method Detail
-
getNumBuckets
public int getNumBuckets()
Returns the number of buckets to divide the result into.- Returns:
- The bucket count.
-
getBucket
public BucketValue getBucket(int i)
Returns the bucket at the given index.- Parameters:
i
- The index of the bucket to return.- Returns:
- The bucket at the given index.
- Throws:
java.lang.IndexOutOfBoundsException
- If the index is out of range.
-
-