net.sf.saffron.rex
Class RexCall

java.lang.Object
  |
  +--net.sf.saffron.rex.RexNode
        |
        +--net.sf.saffron.rex.RexCall

public class RexCall
extends RexNode

An expression formed by a call to an operator with zero or more expressions as operands.

Operators may be binary, unary, functions, special syntactic constructs like CASE ... WHEN ... END, or even internally generated constructs like implicit type conversions. The syntax of the operator is really irrelevant, because row-expressions (unlike SQL expressions) do not directly represent a piece of source code.

It's not often necessary to sub-class this class. The smarts should be in the operator, rather than the call. Any extra information about the call can often be encoded as extra arguments. (These don't need to be hidden, because no one is going to be generating source code from this tree.)

Since:
Nov 24, 2003
Version:
$Id: $
Author:
jhyde

Field Summary
private  RexKind kind
           
 SqlOperator op
           
 RexNode[] operands
           
private  SaffronType type
           
 
Fields inherited from class net.sf.saffron.rex.RexNode
digest
 
Constructor Summary
(package private) RexCall(SaffronType type, SqlOperator op, RexNode[] operands)
           
 
Method Summary
 Object clone()
           
private  String computeDigest()
           
 RexKind getKind()
          Returns the kind of node this is.
 SaffronType getType()
           
(package private) static RexKind sqlKindToRexKind(SqlKind kind)
          Returns the RexKind corresponding to a SqlKind.
 
Methods inherited from class net.sf.saffron.rex.RexNode
isA, isAlwaysTrue, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

op

public final SqlOperator op

operands

public final RexNode[] operands

type

private final SaffronType type

kind

private final RexKind kind
Constructor Detail

RexCall

RexCall(SaffronType type,
        SqlOperator op,
        RexNode[] operands)
Method Detail

sqlKindToRexKind

static RexKind sqlKindToRexKind(SqlKind kind)
Returns the RexKind corresponding to a SqlKind. Fails if there is none.

Post-condition:
return != null
Test-case:
RexTest.testKindMapping()

computeDigest

private String computeDigest()

getType

public SaffronType getType()
Specified by:
getType in class RexNode

clone

public Object clone()
Specified by:
clone in class RexNode

getKind

public RexKind getKind()
Description copied from class: RexNode
Returns the kind of node this is.

Overrides:
getKind in class RexNode
Returns:
A RexKind value, never null

SourceForge.net_Logo