Class AbstractFunction

  • All Implemented Interfaces:
    Function
    Direct Known Subclasses:
    AbstractAggregateFunction

    public abstract class AbstractFunction
    extends java.lang.Object
    implements Function
    An abstract implementation of Function.
    Author:
    Tobias Downer
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractFunction​(java.lang.String name, Expression[] params)
      Constructs the Function with the given expression array as parameters.
    • Constructor Detail

      • AbstractFunction

        public AbstractFunction​(java.lang.String name,
                                Expression[] params)
        Constructs the Function with the given expression array as parameters.
    • Method Detail

      • setAggregate

        protected void setAggregate​(boolean status)
        Call this from the constructor if the function is an aggregate.
      • parameterCount

        public int parameterCount()
        Returns the number of parameters for this function.
      • getParameter

        public Expression getParameter​(int n)
        Returns the parameter at the given index in the parameters list.
      • isGlob

        public boolean isGlob()
        Returns true if the param is the special case glob parameter (*).
      • getName

        public java.lang.String getName()
        Returns the name of the function. The name is a unique identifier that can be used to recreate this function. This identifier can be used to easily serialize the function when grouped with its parameters.
        Specified by:
        getName in interface Function
      • allVariables

        public java.util.List allVariables()
        Returns the list of all Variable's that are used by this function. This looks up each expression in the list of parameters. This will cascade if the expressions have a Function, etc.
        Specified by:
        allVariables in interface Function
      • allElements

        public java.util.List allElements()
        Returns the list of all elements that are used by this function. This looks up each expression in the list of parameters. This will cascade if the expressions have a Function, etc.
        Specified by:
        allElements in interface Function
      • isAggregate

        public final boolean isAggregate​(QueryContext context)
        Returns whether the function is an aggregate function or not.
        Specified by:
        isAggregate in interface Function
      • init

        public void init​(VariableResolver resolver)
        The init function. By default, we don't do anything however this should be overwritten if we need to check the parameter arguments.
      • returnTType

        public TType returnTType()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object