Package mondrian.olap
Enum Syntax
- java.lang.Object
-
- java.lang.Enum<Syntax>
-
- mondrian.olap.Syntax
-
- All Implemented Interfaces:
Serializable
,Comparable<Syntax>
public enum Syntax extends Enum<Syntax>
Enumerated values describing the syntax of an expression.- Since:
- 21 July, 2003
- Author:
- jhyde
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AmpersandQuotedProperty
Defines syntax for expression invokedobject.[&PROPERTY]
(a variant ofProperty
).Braces
Defines syntax for expression invoked as{ARG, ...}
; that is, the set construction operator.Case
Defines syntax for expression invoked asCASE ...
Cast
Defines syntax for a CAST expressionCAST(expression AS type)
.Empty
Defines the syntax for an empty expression.Function
Defines syntax for expression invokedFUNCTION()
orFUNCTION(args)
.Infix
Defines syntax for expression invoked asarg OPERATOR arg
(like '+' or 'AND').Internal
Defines syntax for expression generated by the Mondrian system which cannot be specified syntactically.Method
Defines syntax for expression invoked invoked asobject.METHOD()
orobject.METHOD(args)
.Parentheses
Defines syntax for expression invoked as(ARG)
or(ARG, ...)
; that is, parentheses for grouping expressions, and the tuple construction operator.Postfix
Defines syntax for expression invoked asarg OPERATOR
(likeIS EMPTY
).Prefix
Defines syntax for expression invoked asOPERATOR arg
(like unary '-').Property
Defines syntax for expression invoked asobject.PROPERTY
.QuotedProperty
Defines syntax for expression invokedobject.&PROPERTY
(a variant ofProperty
).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSignature(String name, int returnType, int[] argTypes)
Returns a description of the signature of a function call, for example, "CoalesceEmpty(, )". void
unparse(String fun, Exp[] args, PrintWriter pw)
Converts a call to a function of this syntax into source code.static Syntax
valueOf(String name)
Returns the enum constant of this type with the specified name.static Syntax[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Function
public static final Syntax Function
Defines syntax for expression invokedFUNCTION()
orFUNCTION(args)
.
-
Property
public static final Syntax Property
Defines syntax for expression invoked asobject.PROPERTY
.
-
Method
public static final Syntax Method
Defines syntax for expression invoked invoked asobject.METHOD()
orobject.METHOD(args)
.
-
Infix
public static final Syntax Infix
Defines syntax for expression invoked asarg OPERATOR arg
(like '+' or 'AND').
-
Prefix
public static final Syntax Prefix
Defines syntax for expression invoked asOPERATOR arg
(like unary '-').
-
Postfix
public static final Syntax Postfix
Defines syntax for expression invoked asarg OPERATOR
(likeIS EMPTY
).
-
Braces
public static final Syntax Braces
Defines syntax for expression invoked as{ARG, ...}
; that is, the set construction operator.
-
Parentheses
public static final Syntax Parentheses
Defines syntax for expression invoked as(ARG)
or(ARG, ...)
; that is, parentheses for grouping expressions, and the tuple construction operator.
-
Case
public static final Syntax Case
Defines syntax for expression invoked asCASE ... END
.
-
Internal
public static final Syntax Internal
Defines syntax for expression generated by the Mondrian system which cannot be specified syntactically.
-
Cast
public static final Syntax Cast
Defines syntax for a CAST expressionCAST(expression AS type)
.
-
QuotedProperty
public static final Syntax QuotedProperty
Defines syntax for expression invokedobject.&PROPERTY
(a variant ofProperty
).
-
AmpersandQuotedProperty
public static final Syntax AmpersandQuotedProperty
Defines syntax for expression invokedobject.[&PROPERTY]
(a variant ofProperty
).
-
Empty
public static final Syntax Empty
Defines the syntax for an empty expression. Empty expressions can occur within function calls, and are denoted by a pair of commas with only whitespace between them, for exampleDrillDownLevelTop({[Product].[All Products]}, 3, , [Measures].[Unit Sales])
-
-
Method Detail
-
values
public static Syntax[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Syntax c : Syntax.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Syntax valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
unparse
public void unparse(String fun, Exp[] args, PrintWriter pw)
Converts a call to a function of this syntax into source code.- Parameters:
fun
- Function nameargs
- Arguments to the functionpw
- Writer
-
getSignature
public String getSignature(String name, int returnType, int[] argTypes)
Returns a description of the signature of a function call, for example, "CoalesceEmpty(, )". - Parameters:
name
- Function namereturnType
- Function's return categoryargTypes
- Categories of the function's arguments- Returns:
- Function signature
-
-