org.eigenbase.rex
Class RexNode

java.lang.Object
  extended by org.eigenbase.rex.RexNode
Direct Known Subclasses:
JavaRowExpression, RexCall, RexFieldAccess, RexLiteral, RexRangeRef, RexVariable

public abstract class RexNode
extends Object

Row expression.

Every row-expression has a type. (Compare with SqlNode, which is created before validation, and therefore types may not be available.)

Some common row-expressions are: RexLiteral (constant value), RexVariable (variable), RexCall (call to operator with operands). Expressions are generally created using a RexBuilder factory.

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

Field Summary
protected  String digest
           
static RexNode[] EMPTY_ARRAY
           
 
Constructor Summary
RexNode()
           
 
Method Summary
abstract
<R> R
accept(RexVisitor<R> visitor)
          Accepts a visitor, dispatching to the right overloaded visitXxx method.
abstract  RexNode clone()
           
 RexKind getKind()
          Returns the kind of node this is.
abstract  RelDataType getType()
           
 boolean isA(RexKind kind)
           
 boolean isAlwaysTrue()
          Returns whether this expression always returns true.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final RexNode[] EMPTY_ARRAY

digest

protected String digest
Constructor Detail

RexNode

public RexNode()
Method Detail

getType

public abstract RelDataType getType()

clone

public abstract RexNode clone()
Overrides:
clone in class Object

isAlwaysTrue

public boolean isAlwaysTrue()
Returns whether this expression always returns true. (Such as if this expression is equal to the literal TRUE.)


isA

public boolean isA(RexKind kind)

getKind

public RexKind getKind()
Returns the kind of node this is.

Returns:
A RexKind value, never null
"Postcondition:"
return != null

toString

public String toString()
Overrides:
toString in class Object

accept

public abstract <R> R accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloaded visitXxx method.

Also see RexProgram.apply(RexVisitor, RexNode[], RexNode), which applies a visitor to several expressions simultaneously.