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
ModifierConstructorDescriptionprotected
FunctionNode
(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.int
Returns the number of arguments that were given to this function at construction.iterator()
void
resolveLevel
(int level) Resolves the conceptual level of this expression.void
visit
(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, 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
-
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:
iterator
in interfaceIterable<GroupingExpression>
-
resolveLevel
public void resolveLevel(int level) Description copied from class:GroupingExpression
Resolves 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:
resolveLevel
in classGroupingExpression
- Parameters:
level
- The level of the input data.
-
visit
Description copied from class:GroupingExpression
Recursively callsExpressionVisitor.visitExpression(GroupingExpression)
for this expression and all of its argument expressions.- Overrides:
visit
in classGroupingExpression
- Parameters:
visitor
- The visitor to call.
-
asList
-
asList
-
asList
-