private Java.MethodDeclarator generateFrontendMethod(Location loc) throws Exception { return new Java.MethodDeclarator(loc, null, new Java.Modifiers(Mod.PUBLIC), classToType(loc, returnType), "evaluate", generateArgs(loc, FastTuple.class), new Java.Type[0], Lists.<Java.BlockStatement>newArrayList( maybeGenerateReturn(loc, new Java.MethodInvocation( loc, null, "doEval", new Java.Rvalue[] { new Java.Cast( loc, new Java.ReferenceType(loc, schema.tupleClass().getCanonicalName().split("\\."), null), new Java.AmbiguousName(loc, new String[] {"tuple"}) ) } ) ) ) ); }
protected Java.Rvalue generateSetInvocation(Class type, int index, String value) throws CompileException { return new Java.MethodInvocation(loc, new Java.AmbiguousName(loc, new String[] {"unsafe"}), "put" + accessorForType(type), new Java.Rvalue[]{ new Java.BinaryOperation(loc, new Java.AmbiguousName(loc, new String[]{"address"}), "+", new Java.IntegerLiteral(loc, Integer.toString(layout[index]))), new Java.Cast(loc, classToRefType(type), new Java.AmbiguousName(loc, new String[] {value})) } ); }
@Override protected Java.Rvalue generateSetInvocation(Class type, int index, String value) throws CompileException { return new Java.Assignment(loc, new Java.FieldAccessExpression(loc, new Java.ThisReference(loc), fieldNames[index]), "=", new Java.Cast(loc, classToRefType(fieldTypes[index]), new Java.AmbiguousName(loc, new String[] {value}))); } }