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:
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, 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
-
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 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, 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:
IllegalArgumentException
- Thrown if the list of buckets is empty.
-
-