Class SubFunction
- 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.SubFunction
-
- All Implemented Interfaces:
Iterable<GroupingExpression>
public class SubFunction extends FunctionNode
This class represents a div-function in aGroupingExpression
. It evaluates to a number that equals the result of subtracting the results of all arguments in the order they were given to the constructor (subtract second argument from first, third from result, ...).- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description SubFunction(GroupingExpression arg1, GroupingExpression arg2, GroupingExpression... argN)
Constructs a new instance of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SubFunction
copy()
Returns a deep copy of thisstatic SubFunction
newInstance(List<GroupingExpression> args)
Constructs a new instance of this class from a list of arguments.-
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
-
SubFunction
public SubFunction(GroupingExpression arg1, GroupingExpression arg2, GroupingExpression... argN)
Constructs a new instance of this class.- Parameters:
arg1
- The first compulsory argument, must evaluate to a number.arg2
- The second compulsory argument, must evaluate to a number.argN
- The optional arguments, must evaluate to a number.
-
-
Method Detail
-
copy
public SubFunction copy()
Description copied from class:GroupingExpression
Returns a deep copy of this- Specified by:
copy
in classGroupingExpression
-
newInstance
public static SubFunction newInstance(List<GroupingExpression> args)
Constructs a new instance of this class from a list of arguments.- Parameters:
args
- The arguments to pass to the constructor.- Returns:
- The created instance.
- Throws:
IllegalArgumentException
- Thrown if the number of arguments is less than 2.
-
-