Package mondrian.olap
Class ParameterImpl
- java.lang.Object
-
- mondrian.olap.ParameterImpl
-
- All Implemented Interfaces:
ParameterCompilable,Parameter
public class ParameterImpl extends Object implements Parameter, ParameterCompilable
Implementation ofParameter.- Since:
- Jul 22, 2006
- Author:
- jhyde
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface mondrian.olap.Parameter
Parameter.Scope
-
-
Constructor Summary
Constructors Constructor Description ParameterImpl(String name, Exp defaultExp, String description, Type type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Calccompile(ExpCompiler compiler)protected Objectconvert(Object value)static ObjectconvertBack(Object value)booleanequals(Object other)Returns whether this parameter is equal to another, based upon name, type and valueObject[]getChildren()ExpgetDefaultExp()Returns the expression which provides the default value for this Parameter.StringgetDescription()Returns the description of this Parameter.StringgetName()Returns the name of this Parameter.Parameter.ScopegetScope()Returns the scope where this parameter is defined.TypegetType()Returns the type of this Parameter.ObjectgetValue()Returns the value of this parameter.inthashCode()booleanisModifiable()Returns whether the parameter can be modified.booleanisSet()Returns whether the value of this parameter has been set.voidsetDefaultExp(Exp defaultExp)voidsetDescription(String description)voidsetType(Type type)voidsetValue(Object value)Sets the value of this parameter.voidunsetValue()Unsets the value of this parameter.
-
-
-
Method Detail
-
getScope
public Parameter.Scope getScope()
Description copied from interface:ParameterReturns the scope where this parameter is defined.
-
getType
public Type getType()
Description copied from interface:ParameterReturns the type of this Parameter.
-
getDefaultExp
public Exp getDefaultExp()
Description copied from interface:ParameterReturns the expression which provides the default value for this Parameter. Never null.- Specified by:
getDefaultExpin interfaceParameter- Returns:
- Default value expression of the parameter
-
getName
public String getName()
Description copied from interface:ParameterReturns the name of this Parameter.
-
getValue
public Object getValue()
Description copied from interface:ParameterReturns the value of this parameter.If
Parameter.setValue(Object)has not been called, returns the default value of this parameter.The type of the value is (depending on the type of the parameter) a
String,Number, orMember.
-
setValue
public void setValue(Object value)
Description copied from interface:ParameterSets the value of this parameter.
-
isSet
public boolean isSet()
Description copied from interface:ParameterReturns whether the value of this parameter has been set.If the value has not been set, this parameter will return its default value.
Setting a parameter to
nullis not equivalent to unsetting it. To unset a parameter, callParameter.unsetValue().
-
unsetValue
public void unsetValue()
Description copied from interface:ParameterUnsets the value of this parameter.After calling this method, the parameter will revert to its default value, as if
Parameter.setValue(Object)had not been called, andParameter.isSet()will returnfalse.- Specified by:
unsetValuein interfaceParameter
-
getDescription
public String getDescription()
Description copied from interface:ParameterReturns the description of this Parameter.- Specified by:
getDescriptionin interfaceParameter- Returns:
- Description of the parameter
-
getChildren
public Object[] getChildren()
-
equals
public boolean equals(Object other)
Returns whether this parameter is equal to another, based upon name, type and value
-
isModifiable
public boolean isModifiable()
Returns whether the parameter can be modified.- Specified by:
isModifiablein interfaceParameter- Returns:
- Whether parameter is modifiable
-
setDescription
public void setDescription(String description)
-
setType
public void setType(Type type)
-
setDefaultExp
public void setDefaultExp(Exp defaultExp)
-
compile
public Calc compile(ExpCompiler compiler)
- Specified by:
compilein interfaceParameterCompilable
-
-