Package mondrian.mdx

Class ResolvedFunCall

All Implemented Interfaces:
Exp, FunCall

public final class ResolvedFunCall extends ExpBase implements FunCall
A ResolvedFunCall is a function applied to a list of operands, which has been validated and resolved to a function definition.
Since:
Jan 6, 2006
Author:
jhyde
  • Constructor Details

    • ResolvedFunCall

      public ResolvedFunCall(FunDef funDef, Exp[] args, Type returnType)
      Creates a function call.
      Parameters:
      funDef - Function definition
      args - Arguments
      returnType - Return type
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public ResolvedFunCall clone()
      Specified by:
      clone in interface Exp
      Specified by:
      clone in class ExpBase
    • getArg

      public Exp getArg(int index)
      Returns the Exp argument at the specified index.
      Specified by:
      getArg in interface FunCall
      Parameters:
      index - the index of the Exp.
      Returns:
      the Exp at the specified index of this array of Exp. The first Exp is at index 0.
      See Also:
    • getArgs

      public Exp[] getArgs()
      Returns the internal array of Exp arguments.

      Note: this does NOT do a copy.

      Specified by:
      getArgs in interface FunCall
      Returns:
      the array of expressions
    • getArgCount

      public final int getArgCount()
      Returns the number of arguments.
      Specified by:
      getArgCount in interface FunCall
      Returns:
      number of arguments.
      See Also:
    • getFunName

      public String getFunName()
      Description copied from interface: FunCall
      Returns the name of the function.
      Specified by:
      getFunName in interface FunCall
    • getSyntax

      public Syntax getSyntax()
      Description copied from interface: FunCall
      Returns the syntax of the call.
      Specified by:
      getSyntax in interface FunCall
    • getChildren

      public Object[] getChildren()
      Overrides:
      getChildren in class QueryPart
    • getFunDef

      public FunDef getFunDef()
      Returns the definition of the function which is being called.
      Returns:
      function definition
    • getCategory

      public final int getCategory()
      Description copied from interface: Exp
      Returns the Category of the expression.
      Specified by:
      getCategory in interface Exp
    • getType

      public final Type getType()
      Description copied from interface: Exp
      Returns the type of this expression. Never null.
      Specified by:
      getType in interface Exp
    • accept

      public Exp accept(Validator validator)
      Description copied from interface: Exp
      Validates this expression. The validator acts in the role of 'visitor' (see Gang of Four 'visitor pattern'), and an expression in the role of 'visitee'.
      Specified by:
      accept in interface Exp
      Parameters:
      validator - Validator contains validation context
      Returns:
      The validated expression; often but not always the same as this expression
    • unparse

      public void unparse(PrintWriter pw)
      Description copied from class: QueryPart
      Writes a string representation of this parse tree node to the given writer.
      Specified by:
      unparse in interface Exp
      Overrides:
      unparse in class QueryPart
      Parameters:
      pw - writer
    • accept

      public Calc accept(ExpCompiler compiler)
      Description copied from interface: Exp
      Converts this expression into an a tree of expressions which can be efficiently evaluated.
      Specified by:
      accept in interface Exp
      Overrides:
      accept in class ExpBase
      Returns:
      A compiled expression
    • accept

      public Object accept(MdxVisitor visitor)
      Description copied from interface: Exp
      Accepts a visitor to this Exp. The implementation should generally dispatches to the MdxVisitor.visit(mondrian.olap.Query) method appropriate to the type of expression.
      Specified by:
      accept in interface Exp
      Parameters:
      visitor - Visitor