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
ConstructorDescriptionDoublePredefined
(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 DoublePredefined
newInstance
(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
getNumBuckets
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, 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
-
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:GroupingExpression
Returns a deep copy of this- Specified by:
copy
in classGroupingExpression
-
getBucket
Description copied from class:PredefinedFunction
Returns the bucket at the given index.- Overrides:
getBucket
in 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.
-