Package mondrian.olap
Class Literal
- java.lang.Object
-
- mondrian.olap.QueryPart
-
- mondrian.olap.ExpBase
-
- mondrian.olap.Literal
-
-
Field Summary
Fields Modifier and Type Field Description intcategorystatic LiteraldoubleNegativeOnestatic LiteraldoubleOnestatic LiteraldoubleZerostatic LiteralemptyStringstatic LiteralnegativeOnestatic LiteralnullValuestatic Literalonestatic Literalzero
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Calcaccept(ExpCompiler compiler)Converts this expression into an a tree of expressions which can be efficiently evaluated.Objectaccept(MdxVisitor visitor)Accepts a visitor to this Exp.Expaccept(Validator validator)Validates this expression.Literalclone()static Literalcreate(Double d)Deprecated.static Literalcreate(Integer i)Deprecated.static Literalcreate(BigDecimal d)Creates a numeric literal.static LiteralcreateString(String s)Creates a string literal.static LiteralcreateSymbol(String s)Creates a symbol.intgetCategory()Returns theCategoryof the expression.intgetIntValue()TypegetType()Returns the type of this expression.ObjectgetValue()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, unparseList
-
Methods inherited from class mondrian.olap.QueryPart
explain, getChildren
-
-
-
-
Field Detail
-
category
public final int category
-
nullValue
public static final Literal nullValue
-
emptyString
public static final Literal emptyString
-
zero
public static final Literal zero
-
one
public static final Literal one
-
negativeOne
public static final Literal negativeOne
-
doubleZero
public static final Literal doubleZero
-
doubleOne
public static final Literal doubleOne
-
doubleNegativeOne
public static final Literal doubleNegativeOne
-
-
Method Detail
-
createString
public static Literal createString(String s)
Creates a string literal.- See Also:
createSymbol(java.lang.String)
-
createSymbol
public static Literal createSymbol(String s)
Creates a symbol.- See Also:
createString(java.lang.String)
-
create
public static Literal create(BigDecimal d)
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
public Literal clone()
-
unparse
public void unparse(PrintWriter pw)
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
public Type getType()
Description copied from interface:ExpReturns the type of this expression. Never null.
-
accept
public Exp accept(Validator validator)
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
public Calc accept(ExpCompiler compiler)
Description copied from interface:ExpConverts this expression into an a tree of expressions which can be efficiently evaluated.
-
accept
public Object accept(MdxVisitor visitor)
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
public Object getValue()
-
getIntValue
public int getIntValue()
-
-