mondrian.mdx
Class ParameterExpr

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

public class ParameterExpr
extends ExpBase

MDX expression which is a usage of a Parameter.

Author:
jhyde
 

Constructor Summary
ParameterExpr(Parameter parameter)
           
 
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.
 ParameterExpr clone()
           
 boolean equals(Object other)
          Returns whether this parameter is equal to another, based upon name, type and value
 int getCategory()
          Returns the Category of the expression.
 Object[] getChildren()
          Returns an array of the object's children.
 Parameter getParameter()
          Returns the parameter used by this expression.
 Type getType()
          Returns the type of this expression.
 int hashCode()
           
 boolean isModifiable()
          Returns whether the parameter can be modified.
 void unparse(PrintWriter pw)
          Unparses the definition of this Parameter.
 
Methods inherited from class mondrian.olap.ExpBase
cloneArray, getTypes, unparseList
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterExpr

public ParameterExpr(Parameter parameter)
Method Detail

getType

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


getCategory

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


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

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

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.

Parameters:
visitor - Visitor

clone

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

unparse

public void unparse(PrintWriter pw)
Unparses the definition of this Parameter.

The first usage of a parameter in a query becomes a call to the Parameter(paramName, description, defaultValue) function, and subsequent usages become calls to ParamRef(paramName)

Specified by:
unparse in interface Exp
Overrides:
unparse in class QueryPart
Parameters:
pw - PrintWriter

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

equals

public boolean equals(Object other)
Returns whether this parameter is equal to another, based upon name, type and value

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isModifiable

public boolean isModifiable()
Returns whether the parameter can be modified.

Returns:
whether parameter can be modified

getParameter

public Parameter getParameter()
Returns the parameter used by this expression.

Returns:
parameter used by this expression

SourceForge.net_Logo