Package mondrian.olap
Class Literal
java.lang.Object
mondrian.olap.QueryPart
mondrian.olap.ExpBase
mondrian.olap.Literal
- All Implemented Interfaces:
Exp
Represents a constant value, such as a string or number, in a parse tree.
Symbols, such as the ASC
keyword in
Order([Store].Members, [Measures].[Unit Sales], ASC)
, are
also represented as Literals.
- Author:
- jhyde, 21 January, 1999
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(ExpCompiler compiler) Converts this expression into an a tree of expressions which can be efficiently evaluated.accept
(MdxVisitor visitor) Accepts a visitor to this Exp.Validates this expression.clone()
static Literal
Deprecated.static Literal
Deprecated.static Literal
create
(BigDecimal d) Creates a numeric literal.static Literal
Creates a string literal.static Literal
Creates a symbol.int
Returns theCategory
of the expression.int
getType()
Returns the type of this expression.getValue()
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 mondrian.olap.QueryPart
explain, getChildren
-
Field Details
-
category
public final int category -
nullValue
-
emptyString
-
zero
-
one
-
negativeOne
-
doubleZero
-
doubleOne
-
doubleNegativeOne
-
-
Method Details
-
createString
Creates a string literal.- See Also:
-
createSymbol
Creates a symbol.- See Also:
-
create
Deprecated.Creates a numeric literal. -
create
Deprecated.Creates an integer literal. -
create
Creates a numeric literal.Using a
BigDecimal
allows us to store the precise value that the user typed. We will have to fit the value into a nativedouble
orint
later on, but parse time is not the time to be throwing away information. -
clone
-
unparse
Description copied from class:QueryPart
Writes a string representation of this parse tree node to the given writer. -
getCategory
public int getCategory()Description copied from interface:Exp
Returns theCategory
of the expression. -
getType
Description copied from interface:Exp
Returns the type of this expression. Never null. -
accept
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
Description copied from interface:Exp
Converts this expression into an a tree of expressions which can be efficiently evaluated. -
accept
Description copied from interface:Exp
Accepts a visitor to this Exp. The implementation should generally dispatches to theMdxVisitor.visit(mondrian.olap.Query)
method appropriate to the type of expression.- Parameters:
visitor
- Visitor
-
getValue
-
getIntValue
public int getIntValue()
-
create(java.math.BigDecimal)