mondrian.mdx
Class ResolvedFunCall

java.lang.Object
  extended by mondrian.olap.QueryPart
      extended by mondrian.olap.ExpBase
          extended by mondrian.mdx.ResolvedFunCall
All Implemented Interfaces:
Exp, FunCall, Walkable

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 Summary
ResolvedFunCall(FunDef funDef, Exp[] args, Type returnType)
          Creates a function call.
 
Method Summary
 Calc accept(ExpCompiler compiler)
          Converts this expression into an a tree of expressions which can be efficiently evaluated.
 Object accept(MdxVisitor visitor)
          Accepts a visitor to this Exp.
 Exp accept(Validator validator)
          Validates this expression.
 ResolvedFunCall clone()
           
 Exp getArg(int index)
          Returns the Exp argument at the specified index.
 int getArgCount()
          Returns the number of arguments.
 Exp[] getArgs()
          Returns the internal array of Exp arguments.
 int getCategory()
          Returns the Category of the expression.
 Object[] getChildren()
          Returns an array of the object's children.
 FunDef getFunDef()
          Returns the definition of the function which is being called.
 String getFunName()
          Returns the name of the function.
 Syntax getSyntax()
          Returns the syntax of the call.
 Type getType()
          Returns the type of this expression.
 String toString()
           
 void unparse(PrintWriter pw)
          Writes a string representation of this parse tree node to the given writer.
 
Methods inherited from class mondrian.olap.ExpBase
cloneArray, getTypes, unparseList
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResolvedFunCall

public ResolvedFunCall(FunDef funDef,
                       Exp[] args,
                       Type returnType)
Creates a function call.

Parameters:
funDef - Function definition
args - Arguments
returnType - Return type
Method Detail

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()

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:
getArgs()

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()
Description copied from interface: Walkable
Returns an array of the object's children. Those which are not Walkable are ignored.

Specified by:
getChildren in interface Walkable
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

SourceForge.net_Logo