mondrian.mdx
Class UnresolvedFunCall

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

public class UnresolvedFunCall
extends ExpBase
implements FunCall

An expression consisting of a named function or operator applied to a set of arguments. The syntax determines whether this is called infix, with function call syntax, and so forth.

Since:
Sep 28, 2005
Version:
$Id: //open/mondrian-release/3.0/src/main/mondrian/mdx/UnresolvedFunCall.java#2 $
Author:
jhyde

Constructor Summary
UnresolvedFunCall(String name, Exp[] args)
          Creates a function call with Syntax.Function syntax.
UnresolvedFunCall(String name, Syntax syntax, Exp[] args)
          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.
 UnresolvedFunCall 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.
 String getFunName()
          Returns the function name.
 Syntax getSyntax()
          Returns the syntax of this function call.
 Type getType()
          Returns the type of this expression.
 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, toString, wait, wait, wait
 

Constructor Detail

UnresolvedFunCall

public UnresolvedFunCall(String name,
                         Exp[] args)
Creates a function call with Syntax.Function syntax.


UnresolvedFunCall

public UnresolvedFunCall(String name,
                         Syntax syntax,
                         Exp[] args)
Creates a function call.

Method Detail

clone

public UnresolvedFunCall clone()
Specified by:
clone in interface Exp
Specified by:
clone in class ExpBase

getCategory

public int getCategory()
Description copied from interface: Exp
Returns the Category of the expression.

Specified by:
getCategory in interface Exp

getType

public Type getType()
Description copied from interface: Exp
Returns the type of this expression. Never null.

Specified by:
getType in interface Exp

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

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

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

getFunName

public String getFunName()
Returns the function name.

Specified by:
getFunName in interface FunCall
Returns:
function name

getSyntax

public Syntax getSyntax()
Returns the syntax of this function call.

Specified by:
getSyntax in interface FunCall
Returns:
the syntax of the call

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

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

SourceForge.net_Logo