org.eigenbase.rex
Enum RexKind

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

public enum RexKind
extends Enum<RexKind>

Enumeration of some important types of row-expression.

The values are immutable, canonical constants, so you can use Kinds to find particular types of expressions quickly. To identity a call to a common operator such as '=', use RexNode.isA(org.eigenbase.rex.RexKind):

exp.isA(RexKind.Equals)
To identify a category of expressions, you can use RexNode.isA(org.eigenbase.rex.RexKind) with an aggregate RexKind. The following expression will return true for calls to '=' and '>=', but false for the constant '5', or a call to '+':
exp.isA(RexKind.Comparison)
To quickly choose between a number of options, use a switch statement:
switch (exp.getKind()) {
 case Equals:
     ...;
 case NotEquals:
     ...;
 default:
     throw Util.unexpected(exp.getKind());
 }

Since:
Nov 24, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rex/RexKind.java#14 $
Author:
jhyde

Enum Constant Summary
And
          The logical "AND" operator.
Arithmetic
          An arithmetic operator (Divide, Minus, MinusPrefix, Plus, Times).
Cast
           
Comparison
          A comparison operator (Equals, GreaterThan, etc.).
Concat
          The string concatenation operator, "||".
Divide
          The arithmetic division operator, "/".
DynamicParam
          A dynamic parameter.
Equals
          The equals operator, "=".
FieldAccess
          The field access operator, ".".
GreaterThan
          The greater-than operator, ">".
GreaterThanOrEqual
          The greater-than-or-equal operator, ">=".
Identifier
          An identifier.
IsFalse
          The IS FALSE operator.
IsNull
          The IS NULL operator.
IsTrue
          The IS TRUE operator.
LessThan
          The less-than operator, "<".
LessThanOrEqual
          The less-than-or-equal operator, "<=".
Like
          The LIKE operator.
Literal
          A literal.
Logical
          A logical operator (And, Or, Not).
Minus
          The arithmetic minus operator, "-".
MinusPrefix
          The unary minus operator, as in "-1".
MultisetQueryConstructor
          The MULTISET Query Constructor
NewSpecification
          NEW invocation
Not
          The logical "NOT" operator.
NotEquals
          The not-equals operator, "!=" or "<>".
Or
          The logical "OR" operator.
Other
          No operator in particular.
Plus
          The arithmetic plus operator, "+".
Reinterpret
          The internal REINTERPRET operator
Row
          The row constructor operator.
Similar
          The SIMILAR operator.
Substr
          The substring function.
Times
          The arithmetic multiplication operator, "*".
Trim
           
Values
          The VALUES operator.
 
Field Summary
private  Set<RexKind> otherKinds
           
 
Method Summary
 boolean includes(RexKind kind)
           
static RexKind valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RexKind[] 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

Other

public static final RexKind Other
No operator in particular. This is the default kind.


Equals

public static final RexKind Equals
The equals operator, "=".


NotEquals

public static final RexKind NotEquals
The not-equals operator, "!=" or "<>".


GreaterThan

public static final RexKind GreaterThan
The greater-than operator, ">".


GreaterThanOrEqual

public static final RexKind GreaterThanOrEqual
The greater-than-or-equal operator, ">=".


LessThan

public static final RexKind LessThan
The less-than operator, "<".


LessThanOrEqual

public static final RexKind LessThanOrEqual
The less-than-or-equal operator, "<=".


Comparison

public static final RexKind Comparison
A comparison operator (Equals, GreaterThan, etc.). Comparisons are always a RexCall with 2 arguments.


And

public static final RexKind And
The logical "AND" operator.


Or

public static final RexKind Or
The logical "OR" operator.


Not

public static final RexKind Not
The logical "NOT" operator.


Logical

public static final RexKind Logical
A logical operator (And, Or, Not).


Divide

public static final RexKind Divide
The arithmetic division operator, "/".


Minus

public static final RexKind Minus
The arithmetic minus operator, "-".

See Also:
MinusPrefix

Plus

public static final RexKind Plus
The arithmetic plus operator, "+".


MinusPrefix

public static final RexKind MinusPrefix
The unary minus operator, as in "-1".

See Also:
Minus

Times

public static final RexKind Times
The arithmetic multiplication operator, "*".


Arithmetic

public static final RexKind Arithmetic
An arithmetic operator (Divide, Minus, MinusPrefix, Plus, Times).


FieldAccess

public static final RexKind FieldAccess
The field access operator, ".".


Concat

public static final RexKind Concat
The string concatenation operator, "||".


Substr

public static final RexKind Substr
The substring function.


Row

public static final RexKind Row
The row constructor operator.


IsNull

public static final RexKind IsNull
The IS NULL operator.


Identifier

public static final RexKind Identifier
An identifier.


Literal

public static final RexKind Literal
A literal.


Values

public static final RexKind Values
The VALUES operator.


IsTrue

public static final RexKind IsTrue
The IS TRUE operator.


IsFalse

public static final RexKind IsFalse
The IS FALSE operator.


DynamicParam

public static final RexKind DynamicParam
A dynamic parameter.


Cast

public static final RexKind Cast

Trim

public static final RexKind Trim

Like

public static final RexKind Like
The LIKE operator.


Similar

public static final RexKind Similar
The SIMILAR operator.


MultisetQueryConstructor

public static final RexKind MultisetQueryConstructor
The MULTISET Query Constructor


NewSpecification

public static final RexKind NewSpecification
NEW invocation


Reinterpret

public static final RexKind Reinterpret
The internal REINTERPRET operator

Field Detail

otherKinds

private final Set<RexKind> otherKinds
Method Detail

values

public static final RexKind[] 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(RexKind c : RexKind.values())
        System.out.println(c);

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

valueOf

public static RexKind 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

includes

public boolean includes(RexKind kind)