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 classes inherited from class saffron.rel.Rel |
|
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 |
JavaProject
public JavaProject(Cluster cluster,
Rel child,
Expression[] exps,
String[] fieldNames,
int flags)
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
- implementorordinal
- 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
i
th 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)