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
Fields -
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 LiteralDeprecated.static LiteralDeprecated.static Literalcreate(BigDecimal d) Creates a numeric literal.static LiteralCreates a string literal.static LiteralCreates a symbol.intReturns theCategoryof the expression.intgetType()Returns the type of this expression.getValue()voidunparse(PrintWriter pw) Writes a string representation of this parse tree node to the given writer.Methods inherited from class mondrian.olap.ExpBase
cloneArray, getTypes, unparseListMethods 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
BigDecimalallows us to store the precise value that the user typed. We will have to fit the value into a nativedoubleorintlater on, but parse time is not the time to be throwing away information. -
clone
-
unparse
Description copied from class:QueryPartWrites a string representation of this parse tree node to the given writer. -
getCategory
public int getCategory()Description copied from interface:ExpReturns theCategoryof the expression. -
getType
Description copied from interface:ExpReturns the type of this expression. Never null. -
accept
Description copied from interface:ExpValidates 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:ExpConverts this expression into an a tree of expressions which can be efficiently evaluated. -
accept
Description copied from interface:ExpAccepts 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)