saffron.rel.java
Class JavaProject

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.rel.SingleRel
              |
              +--saffron.rel.Project
                    |
                    +--saffron.rel.java.JavaProject

public class JavaProject
extends Project

JavaProject implements the Project relational expression as Java code.


Nested Class Summary
 
Nested classes inherited from class saffron.rel.Project
Project.Flags
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
 
Fields inherited from class saffron.rel.Project
exps, fieldNames, flags
 
Fields inherited from class saffron.rel.SingleRel
child
 
Fields inherited from class saffron.rel.Rel
cluster, digest, id, rowType
 
Constructor Summary
JavaProject(Cluster cluster, Rel child, Expression[] exps, String[] fieldNames, int flags)
           
 
Method Summary
 Object clone()
           
 CallingConvention getConvention()
          Returns a value from CallingConvention.
 Object implement(Implementor implementor, int ordinal)
          Create a plan for this expression according to a calling convention.
 Expression implementSelf(Implementor implementor)
          Generates the initializer for the variable which holds the current row of this project.
 
Methods inherited from class saffron.rel.Project
computeSelfCost, deriveRowType, explain, getChildExps, getFlags, implementFieldAccess, isBoxed, register
 
Methods inherited from class saffron.rel.SingleRel
childrenAccept, getInputs, replaceInput
 
Methods inherited from class saffron.rel.Rel
computeDigest, getCluster, getCorelVariable, getEnvironment, getId, getInput, getOrCreateCorelVariable, getParentEnv, getQualifier, getQuery, getRelTypeName, getRows, getRowType, getTable, getType, getVariablesStopped, implementExp, implementExps, isAccessTo, isDistinct, onRegister, recomputeDigest, registerCorelVariable, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaProject

public JavaProject(Cluster cluster,
                   Rel child,
                   Expression[] exps,
                   String[] fieldNames,
                   int flags)
Method Detail

clone

public Object clone()
Overrides:
clone in class Project

getConvention

public CallingConvention getConvention()
Description copied from class: Rel
Returns a value from CallingConvention.

Overrides:
getConvention in class Rel

implement

public Object implement(Implementor implementor,
                        int ordinal)
Description copied from class: Rel
Create a plan for this expression according to a calling convention.

Overrides:
implement in class Rel
Parameters:
implementor - implementor
ordinal - indicates our position in the pre-, in- and postfix walk over the tree; ordinal is -1 when called from the parent, and i when called from the ith child.

implementSelf

public Expression implementSelf(Implementor implementor)
Generates the initializer for the variable which holds the current row of this project. If the row-type V is complex, generate V v = new V(exp, ...); <> If the row-type is simple, generate V v = exp; <> Todo: map relations to expressions (not variables), so we don't have to create new objects: T1 v1 = exp1; T2 v2 = exp2; <> Or at least, create a holder object outside the loop, and just assign into it: V v = new V(); <> { v.v1 = exp1; v.v2 = exp2; <> }

Overrides:
implementSelf in class Rel
See Also:
Implementor#bind(Rel,Rel)

SourceForge.net_Logo