org.eigenbase.oj.util
Class JavaRexBuilder

java.lang.Object
  extended by org.eigenbase.rex.RexBuilder
      extended by org.eigenbase.oj.util.JavaRexBuilder
Direct Known Subclasses:
FarragoRexBuilder

public class JavaRexBuilder
extends RexBuilder

Extends RexBuilder to builds row-expressions including those involving Java code.

Since:
Nov 23, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/oj/util/JavaRexBuilder.java#12 $
Author:
jhyde
See Also:
JavaRowExpression

Nested Class Summary
private static class JavaRexBuilder.OJTranslator
           
 
Field Summary
(package private)  JavaRexBuilder.OJTranslator translator
           
 
Fields inherited from class org.eigenbase.rex.RexBuilder
typeFactory
 
Constructor Summary
JavaRexBuilder(RelDataTypeFactory typeFactory)
           
 
Method Summary
 RexNode createMethodCall(Environment env, RexNode exp, String methodName, List<RexNode> args)
          Creates a call to a Java method.
 RexNode makeCase(RexNode rexCond, RexNode rexTrueCase, RexNode rexFalseCase)
           
 RexNode makeCast(RelDataType type, RexNode exp)
          Creates a call to the CAST operator, expanding if possible.
 RexNode makeFieldAccess(RexNode exp, String fieldName)
          Creates an expression accessing a given named field from a record.
 RexNode makeJava(Environment env, Expression expr)
           
 
Methods inherited from class org.eigenbase.rex.RexBuilder
addAggCall, constantNull, copy, deriveReturnType, getOpTab, getTypeFactory, makeAbstractCast, makeApproxLiteral, makeApproxLiteral, makeBigintLiteral, makeBinaryLiteral, makeCall, makeCall, makeCall, makeCharLiteral, makeCorrel, makeDateLiteral, makeDynamicParam, makeExactLiteral, makeExactLiteral, makeFieldAccess, makeFlag, makeInputRef, makeIntervalLiteral, makeIntervalLiteral, makeLiteral, makeLiteral, makeLiteral, makeNewInvocation, makeNotNullCast, makeNullLiteral, makeNullLiteral, makeOver, makePreciseStringLiteral, makeRangeReference, makeRangeReference, makeReinterpretCast, makeTimeLiteral, makeTimestampLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translator

JavaRexBuilder.OJTranslator translator
Constructor Detail

JavaRexBuilder

public JavaRexBuilder(RelDataTypeFactory typeFactory)
Method Detail

makeFieldAccess

public RexNode makeFieldAccess(RexNode exp,
                               String fieldName)
Description copied from class: RexBuilder
Creates an expression accessing a given named field from a record.

Overrides:
makeFieldAccess in class RexBuilder
Parameters:
exp - Expression yielding a record
fieldName - Name of field in record
Returns:
Expression accessing a given named field

createMethodCall

public RexNode createMethodCall(Environment env,
                                RexNode exp,
                                String methodName,
                                List<RexNode> args)
Creates a call to a Java method.

Parameters:
exp - Target of the method
methodName - Name of the method
args - Argument expressions; null means no arguments
Returns:
Method call

makeJava

public RexNode makeJava(Environment env,
                        Expression expr)

makeCase

public RexNode makeCase(RexNode rexCond,
                        RexNode rexTrueCase,
                        RexNode rexFalseCase)

makeCast

public RexNode makeCast(RelDataType type,
                        RexNode exp)
Description copied from class: RexBuilder
Creates a call to the CAST operator, expanding if possible.

Overrides:
makeCast in class RexBuilder
Parameters:
type - Type to cast to
exp - Expression being cast
Returns:
Call to CAST operator