Package com.sun.codemodel

Examples of com.sun.codemodel.JVar.invoke()


    final JVar coordinateslist = unmarshall.body().decl(listGenericsCoordinates, "coordinates", JExpr._new(arraylistGenericsCoordinates));
    unmarshall.body()._if(JExpr.ref(varCoords1.name()).ref("length").lte(JExpr.lit(0)))._then().block()._return(coordinateslist);

    final JForEach forUnMarshall = unmarshall.body().forEach(stringClass, "string", varCoords1);
    forUnMarshall.body().add(coordinateslist.invoke("add").arg(JExpr._new(coordinateClass).arg(forUnMarshall.var())));
    unmarshall.body()._return(coordinateslist);
  }

  private void addSimpleSetterAndGetter(final JDefinedClass coordinateClass, final JFieldVar arg) {
    final JMethod getMethod = coordinateClass.method(JMod.PUBLIC, cm.DOUBLE, "get" + Util.upperFirst(arg.name()));
View Full Code Here


      JVar outVV = g.declareVectorValueSetupAndMember("outgoing", new TypedFieldId(vv.getField().getType(), fieldId, false));

      if(hyper){
       
        g.getEvalBlock().add(
            outVV
            .invoke("copyFrom")
            .arg(
                inIndex.band(JExpr.lit((int) Character.MAX_VALUE)))
            .arg(outIndex)
            .arg(
View Full Code Here

            .arg(
                inVV.component(inIndex.shrz(JExpr.lit(16)))
                )
            )
      }else{
        g.getEvalBlock().add(outVV.invoke("copyFrom").arg(inIndex).arg(outIndex).arg(inVV));
      }
     
     
      fieldId++;
    }
View Full Code Here

      JVar vv = generator.declareVectorValueSetupAndMember(generator.getMappingSet().getOutgoing(), e.getFieldId());
      String setMethod = e.isSafe() ? "setSafe" : "set";
     
      JInvocation setMeth;
      if (Types.usesHolderForGet(inputContainer.getMajorType())) {
        setMeth = vv.invoke("getMutator").invoke(setMethod).arg(outIndex).arg(inputContainer.getHolder());
      }else{
        setMeth = vv.invoke("getMutator").invoke(setMethod).arg(outIndex).arg(inputContainer.getValue());
      }
     
      if(e.isSafe()){
View Full Code Here

     
      JInvocation setMeth;
      if (Types.usesHolderForGet(inputContainer.getMajorType())) {
        setMeth = vv.invoke("getMutator").invoke(setMethod).arg(outIndex).arg(inputContainer.getHolder());
      }else{
        setMeth = vv.invoke("getMutator").invoke(setMethod).arg(outIndex).arg(inputContainer.getValue());
      }
     
      if(e.isSafe()){
        HoldingContainer outputContainer = generator.declare(Types.REQUIRED_BIT);
        block.assign(outputContainer.getValue(), JExpr.lit(1));
View Full Code Here

      // declare value vector
     
      JVar vv1 = generator.declareVectorValueSetupAndMember(generator.getMappingSet().getIncoming(), e.getFieldId());
      JExpression indexVariable = generator.getMappingSet().getValueReadIndex();

      JInvocation getValueAccessor = vv1.invoke("getAccessor").invoke("get");
      JInvocation getValueAccessor2 = vv1.invoke("getAccessor");
      if (e.isSuperReader()) {

        getValueAccessor = ((JExpression) vv1.component(indexVariable.shrz(JExpr.lit(16)))).invoke("getAccessor").invoke("get");
        getValueAccessor2 = ((JExpression) vv1.component(indexVariable.shrz(JExpr.lit(16)))).invoke("getAccessor");
View Full Code Here

     
      JVar vv1 = generator.declareVectorValueSetupAndMember(generator.getMappingSet().getIncoming(), e.getFieldId());
      JExpression indexVariable = generator.getMappingSet().getValueReadIndex();

      JInvocation getValueAccessor = vv1.invoke("getAccessor").invoke("get");
      JInvocation getValueAccessor2 = vv1.invoke("getAccessor");
      if (e.isSuperReader()) {

        getValueAccessor = ((JExpression) vv1.component(indexVariable.shrz(JExpr.lit(16)))).invoke("getAccessor").invoke("get");
        getValueAccessor2 = ((JExpression) vv1.component(indexVariable.shrz(JExpr.lit(16)))).invoke("getAccessor");
        indexVariable = indexVariable.band(JExpr.lit((int) Character.MAX_VALUE));
View Full Code Here

      JVar vvIn = cg.declareVectorValueSetupAndMember("incomingLeft",
                                                      new TypedFieldId(vw.getField().getType(), vectorId));
      JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
                                                       new TypedFieldId(vw.getField().getType(),vectorId));
      // todo: check result of copyFromSafe and grow allocation
      cg.getEvalBlock().add(vvOut.invoke("copyFromSafe")
                                   .arg(COPY_LEFT_MAPPING.getValueReadIndex())
                                   .arg(COPY_LEFT_MAPPING.getValueWriteIndex())
                                   .arg(vvIn));
      ++vectorId;
    }
View Full Code Here

      JVar vvIn = cg.declareVectorValueSetupAndMember("incomingRight",
                                                      new TypedFieldId(vw.getField().getType(), vectorId - rightVectorBase));
      JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
                                                       new TypedFieldId(vw.getField().getType(),vectorId));
      // todo: check result of copyFromSafe and grow allocation
      cg.getEvalBlock().add(vvOut.invoke("copyFromSafe")
          .arg(COPY_RIGHT_MAPPING.getValueReadIndex())
          .arg(COPY_RIGHT_MAPPING.getValueWriteIndex())
          .arg(vvIn));
      ++vectorId;
    }
View Full Code Here

  private void getIndex(CodeGenerator<Aggregator> g){
    switch(incoming.getSchema().getSelectionVectorMode()){
    case FOUR_BYTE: {
      JVar var = g.declareClassField("sv4_", g.getModel()._ref(SelectionVector4.class));
      g.getBlock("setupInterior").assign(var, JExpr.direct("incoming").invoke("getSelectionVector4"));
      g.getBlock("getVectorIndex")._return(var.invoke("get").arg(JExpr.direct("recordIndex")));;
      return;
    }
    case NONE: {
      g.getBlock("getVectorIndex")._return(JExpr.direct("recordIndex"));;
      return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.