Class DoublePredefined
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
com.yahoo.search.grouping.request.DoublePredefined
- All Implemented Interfaces:
Iterable<GroupingExpression>
This class represents a predefined bucket-function in a
GroupingExpression for expressions that evaluate to a
double.- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorsConstructorDescriptionDoublePredefined(GroupingExpression exp, DoubleBucket arg1, DoubleBucket... argN) Constructs a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of thisgetBucket(int i) Returns the bucket at the given index.static DoublePredefinednewInstance(GroupingExpression exp, List<DoubleBucket> args) Constructs a new instance of this class from a list of arguments.Methods inherited from class com.yahoo.search.grouping.request.PredefinedFunction
getNumBucketsMethods inherited from class com.yahoo.search.grouping.request.FunctionNode
args, asList, asList, asList, getArg, getNumArgs, iterator, resolveLevel, visitMethods inherited from class com.yahoo.search.grouping.request.GroupingExpression
asImage, asString, getLevel, getLevelOrNull, setLabelMethods inherited from class com.yahoo.search.grouping.request.GroupingNode
getImage, getLabel, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DoublePredefined
Constructs a new instance of this class.- Parameters:
exp- The expression to evaluate, must evaluate to a double.arg1- The compulsory bucket.argN- The optional buckets.
-
-
Method Details
-
copy
Description copied from class:GroupingExpressionReturns a deep copy of this- Specified by:
copyin classGroupingExpression
-
getBucket
Description copied from class:PredefinedFunctionReturns the bucket at the given index.- Overrides:
getBucketin classPredefinedFunction- Parameters:
i- The index of the bucket to return.- Returns:
- The bucket at the given index.
-
newInstance
Constructs a new instance of this class from a list of arguments.- Parameters:
exp- The expression to evaluate, must evaluate to a double.args- The buckets to pass to the constructor.- Returns:
- The created instance.
- Throws:
IllegalArgumentException- Thrown if the list of buckets is empty.
-