| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.sf.saffron.rex.RexBuilder
Factory for row expressions.
Some common literal values (NULL, TRUE, FALSE, 0, 1, '') are cached.
| Field Summary | |
| private  RexLiteral | booleanFalse | 
| private  RexLiteral | booleanTrue | 
| private  RexLiteral | constantNull | 
| private  RexLiteral | integerOne | 
| private  RexLiteral | integerZero | 
|  SqlOperatorTable | operatorTable | 
| protected  SaffronTypeFactory | typeFactory | 
| private  RexLiteral | varcharEmpty | 
| Constructor Summary | |
| protected  | RexBuilder(SaffronTypeFactory typeFactory) | 
| Method Summary | |
|  RexLiteral | constantNull()Creates a constant for the SQL NULLvalue. | 
|  SqlOperator | getOperator(RexKind kind,
            RexNode[] args)Chooses an appropriate operator to implement a RexKind, given
 a specific number and types of arguments. | 
|  SaffronTypeFactory | getTypeFactory() | 
| private  SaffronType[] | getTypes(RexNode[] exprs) | 
|  RexNode | makeCall(RexKind kind,
         RexNode arg0)Creates a call with 1 argument, converting a RexKindto an appropriateSqlOperator. | 
|  RexNode | makeCall(RexKind kind,
         RexNode[] args)Creates a call with an array of arguments, converting a RexKindto an appropriateSqlOperator. | 
|  RexNode | makeCall(RexKind kind,
         RexNode arg0,
         RexNode arg1)Creates a call with 2 arguments, converting a RexKindto an appropriateSqlOperator. | 
|  RexNode | makeCall(SqlOperator op,
         RexNode[] exprs)Creates a call with an array of arguments. | 
|  RexNode | makeCall(SqlOperator op,
         RexNode expr0,
         RexNode expr1)Creates a call with 2 arguments. | 
|  RexNode | makeCast(SaffronType type,
         RexNode exp) | 
|  RexNode | makeCorrel(SaffronType type,
           String name) | 
|  RexNode | makeFieldAccess(RexNode expr,
                int i) | 
|  RexNode | makeFieldAccess(RexNode expr,
                String fieldName) | 
| private  RexNode | makeFieldAccessInternal(RexNode expr,
                        SaffronField field) | 
|  RexNode | makeInputRef(SaffronType type,
             int i) | 
|  RexLiteral | makeLiteral(boolean b)Creates a boolean literal. | 
|  RexLiteral | makeLiteral(Date date)Creates a Date literal. | 
|  RexLiteral | makeLiteral(double d)Creates a double-precision literal. | 
|  RexLiteral | makeLiteral(long i)Creates an integer literal. | 
| protected  RexLiteral | makeLiteral(Object o,
            SaffronType type) | 
|  RexLiteral | makeLiteral(String s)Creates a varchar literal. | 
|  RexLiteral | makeLiteral(Time time)Creates a Time literal. | 
|  RexLiteral | makeLiteral(Timestamp timestamp)Creates a Timestamp literal. | 
|  RexNode | makeRangeReference(SaffronType rowType)Creates a reference to all the fields in the row. | 
|  RexNode | makeRangeReference(SaffronType type,
                   int i)Creates a reference to all the fields in the row. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
protected final SaffronTypeFactory typeFactory
private final RexLiteral booleanTrue
private final RexLiteral booleanFalse
private final RexLiteral integerZero
private final RexLiteral integerOne
private final RexLiteral varcharEmpty
private final RexLiteral constantNull
public final SqlOperatorTable operatorTable
| Constructor Detail | 
protected RexBuilder(SaffronTypeFactory typeFactory)
| Method Detail | 
public SaffronTypeFactory getTypeFactory()
public RexNode makeFieldAccess(RexNode expr,
                               String fieldName)
public RexNode makeFieldAccess(RexNode expr,
                               int i)
private RexNode makeFieldAccessInternal(RexNode expr,
                                        SaffronField field)
public RexNode makeCall(RexKind kind,
                        RexNode arg0)
RexKind
 to an appropriate SqlOperator.
public RexNode makeCall(RexKind kind,
                        RexNode[] args)
RexKind
 to an appropriate SqlOperator.
public RexNode makeCall(RexKind kind,
                        RexNode arg0,
                        RexNode arg1)
RexKind
 to an appropriate SqlOperator.
public RexNode makeCall(SqlOperator op,
                        RexNode expr0,
                        RexNode expr1)
public RexNode makeCall(SqlOperator op,
                        RexNode[] exprs)
This is the fundamental method called by all of the other
 makeCall methods. If you derive a class from
 RexBuilder, this is the only method you need to override.
private SaffronType[] getTypes(RexNode[] exprs)
public SqlOperator getOperator(RexKind kind,
                               RexNode[] args)
RexKind, given
 a specific number and types of arguments.
public RexLiteral constantNull()
NULL value.
public RexNode makeCorrel(SaffronType type,
                          String name)
public RexNode makeCast(SaffronType type,
                        RexNode exp)
public RexNode makeRangeReference(SaffronType rowType)
rowType - Type of the input row
public RexNode makeRangeReference(SaffronType type,
                                  int i)
T{f0,f1,f2,f3,f4}
 then makeRangeReference(T{f0,f1,f2,f3,f4}, S{f3,f4}, 3)
 is an expression which yields the last 2 fields.
type - Type of the resulting range record.i - Index of first field
public RexNode makeInputRef(SaffronType type,
                            int i)
protected RexLiteral makeLiteral(Object o,
                                 SaffronType type)
public RexLiteral makeLiteral(boolean b)
public RexLiteral makeLiteral(long i)
public RexLiteral makeLiteral(double d)
public RexLiteral makeLiteral(String s)
public RexLiteral makeLiteral(Date date)
public RexLiteral makeLiteral(Time time)
public RexLiteral makeLiteral(Timestamp timestamp)
| 
 |  | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||