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