mondrian.olap
Enum Syntax

java.lang.Object
  extended by java.lang.Enum<Syntax>
      extended by 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
AmpersandQuotedProperty
          Defines syntax for expression invoked object.[&PROPERTY] (a variant of Property).
Braces
          Defines syntax for expression invoked as {ARG, ...}; that is, the set construction operator.
Case
          Defines syntax for expression invoked as CASE ...
Cast
          Defines syntax for a CAST expression CAST(expression AS type).
Empty
          Defines the syntax for an empty expression.
Function
          Defines syntax for expression invoked FUNCTION() or FUNCTION(args).
Infix
          Defines syntax for expression invoked as arg 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 as object.METHOD() or object.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 as arg OPERATOR (like IS EMPTY).
Prefix
          Defines syntax for expression invoked as OPERATOR arg (like unary '-').
Property
          Defines syntax for expression invoked as object.PROPERTY.
QuotedProperty
          Defines syntax for expression invoked object.&PROPERTY (a variant of Property).
 
Method Summary
 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Function

public static final Syntax Function
Defines syntax for expression invoked FUNCTION() or FUNCTION(args).


Property

public static final Syntax Property
Defines syntax for expression invoked as object.PROPERTY.


Method

public static final Syntax Method
Defines syntax for expression invoked invoked as object.METHOD() or object.METHOD(args).


Infix

public static final Syntax Infix
Defines syntax for expression invoked as arg OPERATOR arg (like '+' or 'AND').


Prefix

public static final Syntax Prefix
Defines syntax for expression invoked as OPERATOR arg (like unary '-').


Postfix

public static final Syntax Postfix
Defines syntax for expression invoked as arg OPERATOR (like IS 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 as CASE ... 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 expression CAST(expression AS type).


QuotedProperty

public static final Syntax QuotedProperty
Defines syntax for expression invoked object.&PROPERTY (a variant of Property).


AmpersandQuotedProperty

public static final Syntax AmpersandQuotedProperty
Defines syntax for expression invoked object.[&PROPERTY] (a variant of Property).


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 example
DrillDownLevelTop({[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.)

Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name

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 name
args - Arguments to the function
pw - 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 name
returnType - Function's return category
argTypes - Categories of the function's arguments
Returns:
Function signature

SourceForge.net_Logo