|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.util.EnumeratedValues.BasicValue | +--net.sf.saffron.rex.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(net.sf.saffron.rex.RexKind)
:
To identify a category of expressions, you can useexp.isA
(RexKind.Equals
)
RexNode.isA(net.sf.saffron.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 '+':To quickly choose between a number of options, use theexp.isA
(RexKind.Comparison
)
ordinal
property:switch (exp.getKind().getOrdinal()) { caseRexKind.Equals_ORDINAL
: ...; caseRexKind.NotEquals_ORDINAL
: ...; default: throw exp.getKind().unexpected
(); }
Field Summary | |
static RexKind |
And
The logical "AND" operator. |
static int |
AndORDINAL
|
static RexKind |
Arithmetic
An arithmetic operator ( Divide , Minus ,
MinusPrefix , Plus , Times ). |
static int |
ArithmeticORDINAL
|
static RexKind |
Comparison
A comparison operator ( Equals , GreaterThan , etc.). |
static int |
ComparisonORDINAL
|
static RexKind |
Concat
The string concatenation operator, "||". |
static int |
ConcatORDINAL
|
static RexKind |
Divide
The arithmetic division operator, "/". |
static int |
DivideORDINAL
|
static EnumeratedValues |
enumeration
Set of all RexKind instances. |
static RexKind |
Equals
The equals operator, "=". |
static int |
EqualsORDINAL
|
static RexKind |
FieldAccess
The arithmetic multiplication operator, "*". |
static int |
FieldAccessORDINAL
|
static int |
GreaterEqualORDINAL
|
static RexKind |
GreaterThan
The greater-than operator, ">". |
static int |
GreaterThanORDINAL
|
static RexKind |
GreaterThanOrEqual
The greater-than-or-equal operator, ">=". |
static RexKind |
Identifier
An identifier. |
static int |
IdentifierORDINAL
|
static RexKind |
IsNull
The IS NULL operator. |
static int |
IsNullORDINAL
|
static RexKind |
LessThan
The less-than operator, "<". |
static int |
LessThanORDINAL
|
static RexKind |
LessThanOrEqual
The less-than-or-equal operator, "<=". |
static int |
LessThanOrEqualORDINAL
|
static RexKind |
Literal
A literal. |
static int |
LiteralORDINAL
|
static RexKind |
Logical
A logical operator ( And , Or , Not ). |
static int |
LogicalORDINAL
|
static RexKind |
Minus
The arithmetic minus operator, "-". |
static int |
MinusORDINAL
|
static RexKind |
MinusPrefix
The unary minus operator, as in "-1". |
static int |
MinusPrefixORDINAL
|
static RexKind |
Not
The logical "NOT" operator. |
static RexKind |
NotEquals
The not-equals operator, "!=" or "<>". |
static int |
NotEqualsORDINAL
|
static int |
NotORDINAL
|
static RexKind |
Or
The logical "OR" operator. |
static int |
OrORDINAL
|
static RexKind |
Other
No operator in particular. |
private Set |
otherKinds
|
static int |
OtherORDINAL
|
static RexKind |
Plus
The arithmetic plus operator, "+". |
static int |
PlusORDINAL
|
static RexKind |
Row
The row constructor operator. |
static int |
RowORDINAL
|
static RexKind |
Substr
The substring function. |
static int |
SubstrORDINAL
|
static RexKind |
Times
The arithmetic multiplication operator, "*". |
static int |
TimesORDINAL
|
static RexKind |
Values
The VALUES operator. |
static int |
ValuesORDINAL
|
Fields inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue |
description_, name_, ordinal_ |
Constructor Summary | |
private |
RexKind(String name,
int ordinal)
Creates a kind. |
private |
RexKind(String name,
int ordinal,
RexKind[] others)
Creates a kind which includes other kinds. |
Method Summary | |
static RexKind |
get(int ordinal)
Looks up a kind from its ordinal. |
static RexKind |
get(String name)
Looks up a kind from its name. |
boolean |
includes(RexKind kind)
|
Methods inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue |
equals, getDescription, getName, getOrdinal, toString, unexpected |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Set otherKinds
public static final int OtherORDINAL
public static final RexKind Other
public static final int EqualsORDINAL
public static final RexKind Equals
public static final int NotEqualsORDINAL
public static final RexKind NotEquals
public static final int GreaterThanORDINAL
public static final RexKind GreaterThan
public static final int GreaterEqualORDINAL
public static final RexKind GreaterThanOrEqual
public static final int LessThanORDINAL
public static final RexKind LessThan
public static final int LessThanOrEqualORDINAL
public static final RexKind LessThanOrEqual
public static final int ComparisonORDINAL
public static final RexKind Comparison
Equals
, GreaterThan
, etc.).
Comparisons are always a RexCall
with 2 arguments.
public static final int AndORDINAL
public static final RexKind And
public static final int OrORDINAL
public static final RexKind Or
public static final int NotORDINAL
public static final RexKind Not
public static final int LogicalORDINAL
public static final RexKind Logical
And
, Or
, Not
).
public static final int DivideORDINAL
public static final RexKind Divide
public static final int MinusORDINAL
public static final RexKind Minus
MinusPrefix
public static final int PlusORDINAL
public static final RexKind Plus
public static final int MinusPrefixORDINAL
public static final RexKind MinusPrefix
Minus
public static final int TimesORDINAL
public static final RexKind Times
public static final int ArithmeticORDINAL
public static final RexKind Arithmetic
Divide
, Minus
,
MinusPrefix
, Plus
, Times
).
public static final int FieldAccessORDINAL
public static final RexKind FieldAccess
public static final int ConcatORDINAL
public static final RexKind Concat
public static final int SubstrORDINAL
public static final RexKind Substr
public static final int RowORDINAL
public static final RexKind Row
public static final int IsNullORDINAL
public static final RexKind IsNull
public static final int IdentifierORDINAL
public static final RexKind Identifier
public static final int LiteralORDINAL
public static final RexKind Literal
public static final int ValuesORDINAL
public static final RexKind Values
public static final EnumeratedValues enumeration
RexKind
instances.
Constructor Detail |
private RexKind(String name, int ordinal)
private RexKind(String name, int ordinal, RexKind[] others)
Method Detail |
public boolean includes(RexKind kind)
public static RexKind get(int ordinal)
public static RexKind get(String name)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |