org.eigenbase.sql
Enum SqlSyntax

java.lang.Object
  extended by java.lang.Enum<SqlSyntax>
      extended by org.eigenbase.sql.SqlSyntax
All Implemented Interfaces:
Serializable, Comparable<SqlSyntax>

public enum SqlSyntax
extends Enum<SqlSyntax>

Enumeration of possible syntactic types of operators.

Since:
June 28, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlSyntax.java#13 $
Author:
jhyde

Enum Constant Summary
Binary
          Binary operator syntax, as in "x + y".
Function
          Function syntax, as in "Foo(x, y)".
FunctionId
          Function syntax which takes no parentheses if there are no arguments, for example "CURRENTTIME".
Internal
          Syntax of an internal operator, which does not appear in the SQL.
Postfix
          Postfix unary operator syntax, as in "x ++".
Prefix
          Prefix unary operator syntax, as in "- x".
Special
          Special syntax, such as that of the SQL CASE operator, "CASE x WHEN 1 THEN 2 ELSE 3 END".
 
Method Summary
abstract  void unparse(SqlWriter writer, SqlOperator operator, SqlNode[] operands, int leftPrec, int rightPrec)
          Converts a call to an operator of this syntax into a string.
static SqlSyntax valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SqlSyntax[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Function

public static final SqlSyntax Function
Function syntax, as in "Foo(x, y)".


Binary

public static final SqlSyntax Binary
Binary operator syntax, as in "x + y".


Prefix

public static final SqlSyntax Prefix
Prefix unary operator syntax, as in "- x".


Postfix

public static final SqlSyntax Postfix
Postfix unary operator syntax, as in "x ++".


Special

public static final SqlSyntax Special
Special syntax, such as that of the SQL CASE operator, "CASE x WHEN 1 THEN 2 ELSE 3 END".


FunctionId

public static final SqlSyntax FunctionId
Function syntax which takes no parentheses if there are no arguments, for example "CURRENTTIME".


Internal

public static final SqlSyntax Internal
Syntax of an internal operator, which does not appear in the SQL.

Method Detail

values

public static final SqlSyntax[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SqlSyntax c : SqlSyntax.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SqlSyntax 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 name

unparse

public abstract void unparse(SqlWriter writer,
                             SqlOperator operator,
                             SqlNode[] operands,
                             int leftPrec,
                             int rightPrec)
Converts a call to an operator of this syntax into a string.