Class FunctionNode
java.lang.Object
com.yahoo.search.grouping.request.GroupingNode
com.yahoo.search.grouping.request.GroupingExpression
com.yahoo.search.grouping.request.FunctionNode
- All Implemented Interfaces:
Iterable<GroupingExpression>
- Direct Known Subclasses:
AddFunction,AndFunction,AvgFunction,CatFunction,DateFunction,DayOfMonthFunction,DayOfWeekFunction,DayOfYearFunction,DebugWaitFunction,DivFunction,FixedWidthFunction,HourOfDayFunction,MathACosFunction,MathACosHFunction,MathASinFunction,MathASinHFunction,MathATanFunction,MathATanHFunction,MathCbrtFunction,MathCosFunction,MathCosHFunction,MathExpFunction,MathFloorFunction,MathHypotFunction,MathLog10Function,MathLog1pFunction,MathLogFunction,MathPowFunction,MathSinFunction,MathSinHFunction,MathSqrtFunction,MathTanFunction,MathTanHFunction,MaxFunction,Md5Function,MinFunction,MinuteOfHourFunction,ModFunction,MonthOfYearFunction,MulFunction,NegFunction,NormalizeSubjectFunction,NowFunction,OrFunction,PredefinedFunction,ReverseFunction,SecondOfMinuteFunction,SizeFunction,SortFunction,StrCatFunction,StrLenFunction,SubFunction,ToDoubleFunction,ToLongFunction,ToRawFunction,ToStringFunction,UcaFunction,XorBitFunction,XorFunction,YearFunction,ZCurveXFunction,ZCurveYFunction
public abstract class FunctionNode
extends GroupingExpression
implements Iterable<GroupingExpression>
This class represents a function in a
GroupingExpression. Because it operate on other expressions (as opposed
to AggregatorNode and DocumentValue that operate on inputs), this expression type can be used at any
input level (see GroupingExpression.resolveLevel(int)).- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFunctionNode(String image, String label, Integer level, List<GroupingExpression> args) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<GroupingExpression>args()Returns the arguments of this as a list which cannot be modifiedprotected static <T> List<T>protected static <T> List<T>asList(T arg1, T... argN) protected static <T> List<T>asList(T arg1, T arg2, T... argN) getArg(int i) Returns the argument at the given index.intReturns the number of arguments that were given to this function at construction.iterator()voidresolveLevel(int level) Resolves the conceptual level of this expression.voidvisit(ExpressionVisitor visitor) Recursively callsExpressionVisitor.visitExpression(GroupingExpression)for this expression and all of its argument expressions.Methods inherited from class com.yahoo.search.grouping.request.GroupingExpression
asImage, asString, copy, 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
-
FunctionNode
-
-
Method Details
-
getNumArgs
public int getNumArgs()Returns the number of arguments that were given to this function at construction.- Returns:
- The argument count.
-
getArg
Returns the argument at the given index.- Parameters:
i- The index of the argument to return.- Returns:
- The argument at the given index.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
args
Returns the arguments of this as a list which cannot be modified -
iterator
- Specified by:
iteratorin interfaceIterable<GroupingExpression>
-
resolveLevel
public void resolveLevel(int level) Description copied from class:GroupingExpressionResolves the conceptual level of this expression. This level represents the type of data that is consumed by this expression, where level 0 is a single hit, level 1 is a group, level 2 is a list of groups, and so forth. This method verifies the input level against the expression type, and recursively resolves the level of all argument expressions.- Overrides:
resolveLevelin classGroupingExpression- Parameters:
level- The level of the input data.
-
visit
Description copied from class:GroupingExpressionRecursively callsExpressionVisitor.visitExpression(GroupingExpression)for this expression and all of its argument expressions.- Overrides:
visitin classGroupingExpression- Parameters:
visitor- The visitor to call.
-
asList
-
asList
-
asList
-