Class LongPredefined
- 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.LongPredefined
-
- All Implemented Interfaces:
java.lang.Iterable<GroupingExpression>
public class LongPredefined extends PredefinedFunction
This class represents a predefined bucket-function in aGroupingExpression
for expressions that evaluate to a long.- Author:
- Simon Thoresen Hult, bratseth
-
-
Constructor Summary
Constructors Constructor Description LongPredefined(GroupingExpression exp, LongBucket arg1, LongBucket... argN)
Constructs a new instance of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LongPredefined
copy()
Returns a deep copy of thisLongBucket
getBucket(int i)
Returns the bucket at the given index.static LongPredefined
newInstance(GroupingExpression exp, java.util.List<LongBucket> 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
-
-
-
-
Constructor Detail
-
LongPredefined
public LongPredefined(GroupingExpression exp, LongBucket arg1, LongBucket... argN)
Constructs a new instance of this class.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.arg1
- The compulsory bucket.argN
- The optional buckets.
-
-
Method Detail
-
copy
public LongPredefined copy()
Description copied from class:GroupingExpression
Returns a deep copy of this- Specified by:
copy
in classGroupingExpression
-
getBucket
public LongBucket getBucket(int i)
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
public static LongPredefined newInstance(GroupingExpression exp, java.util.List<LongBucket> args)
Constructs a new instance of this class from a list of arguments.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.args
- The buckets to pass to the constructor.- Returns:
- The created instance.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the list of buckets is empty.
-
-