Class 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 Details

  • Method Details

    • getNumArgs

      public int getNumArgs()
      Returns the number of arguments that were given to this function at construction.
      Returns:
      The argument count.
    • getArg

      public GroupingExpression getArg(int i)
      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

      protected List<GroupingExpression> args()
      Returns the arguments of this as a list which cannot be modified
    • iterator

      public Iterator<GroupingExpression> iterator()
      Specified by:
      iterator in interface Iterable<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 class GroupingExpression
      Parameters:
      level - The level of the input data.
    • visit

      public void visit(ExpressionVisitor visitor)
      Description copied from class: GroupingExpression
      Recursively calls ExpressionVisitor.visitExpression(GroupingExpression) for this expression and all of its argument expressions.
      Overrides:
      visit in class GroupingExpression
      Parameters:
      visitor - The visitor to call.
    • asList

      protected static <T> List<T> asList(T arg1, T... argN)
    • asList

      protected static <T> List<T> asList(T arg1, T arg2, T... argN)
    • asList

      protected static <T> List<T> asList(List<T> foo, List<T> bar)