當前位置: 首頁>>代碼示例>>Java>>正文


Java JVar.ref方法代碼示例

本文整理匯總了Java中com.sun.codemodel.JVar.ref方法的典型用法代碼示例。如果您正苦於以下問題:Java JVar.ref方法的具體用法?Java JVar.ref怎麽用?Java JVar.ref使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.codemodel.JVar的用法示例。


在下文中一共展示了JVar.ref方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visitDecimalConstant

import com.sun.codemodel.JVar; //導入方法依賴的package包/類
@Override
public HoldingContainer visitDecimalConstant(DecimalExpression e, ClassGenerator<?> generator)
    throws RuntimeException {
  CompleteType majorType= e.getCompleteType();
  JBlock setup = generator.getBlock(BlockType.SETUP);
  JType holderType = majorType.getHolderType(generator.getModel());
  JVar var = generator.declareClassField("dec", holderType);
  JExpression valueLiteral = JExpr.lit(e.getIntFromDecimal());
  JExpression scaleLiteral = JExpr.lit(e.getScale());
  JExpression precisionLiteral = JExpr.lit(e.getPrecision());
  setup.assign(
      var,
      generator.getModel().ref(ValueHolderHelper.class).staticInvoke("getNullableDecimalHolder").arg(valueLiteral)
          .arg(scaleLiteral).arg(precisionLiteral));
  return new HoldingContainer(majorType, var, var.ref("value"), var.ref("isSet"));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:17,代碼來源:EvaluationVisitor.java

示例2: declare

import com.sun.codemodel.JVar; //導入方法依賴的package包/類
public HoldingContainer declare(MajorType t, boolean includeNewInstance) {
  JType holderType = getHolderType(t);
  JVar var;
  if (includeNewInstance) {
    var = getEvalBlock().decl(holderType, "out" + index, JExpr._new(holderType));
  } else {
    var = getEvalBlock().decl(holderType, "out" + index);
  }
  JFieldRef outputSet = null;
  if (t.getMode() == DataMode.OPTIONAL) {
    outputSet = var.ref("isSet");
  }
  index++;
  return new HoldingContainer(t, var, var.ref("value"), outputSet);
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:16,代碼來源:ClassGenerator.java

示例3: visitQuotedStringConstant

import com.sun.codemodel.JVar; //導入方法依賴的package包/類
@Override
public HoldingContainer visitQuotedStringConstant(QuotedString e, ClassGenerator<?> generator)
    throws RuntimeException {
  CompleteType completeType = CompleteType.VARCHAR;
  JBlock setup = generator.getBlock(BlockType.SETUP);
  JType holderType = completeType.getHolderType(generator.getModel());
  JVar var = generator.declareClassField("string", holderType);
  JExpression stringLiteral = JExpr.lit(e.value);
  JExpression buffer = JExpr.direct("context").invoke("getManagedBuffer");
  setup.assign(var,
      generator.getModel().ref(ValueHolderHelper.class).staticInvoke("getNullableVarCharHolder").arg(buffer).arg(stringLiteral));
  return new HoldingContainer((completeType), var, var.ref("value"), var.ref("isSet"));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:14,代碼來源:EvaluationVisitor.java

示例4: visitIntervalDayConstant

import com.sun.codemodel.JVar; //導入方法依賴的package包/類
@Override
public HoldingContainer visitIntervalDayConstant(IntervalDayExpression e, ClassGenerator<?> generator)
    throws RuntimeException {
  CompleteType completeType = CompleteType.INTERVAL_DAY_SECONDS;
  JBlock setup = generator.getBlock(BlockType.SETUP);
  JType holderType = completeType.getHolderType(generator.getModel());
  JVar var = generator.declareClassField("intervalday", holderType);
  JExpression dayLiteral = JExpr.lit(e.getIntervalDay());
  JExpression millisLiteral = JExpr.lit(e.getIntervalMillis());
  setup.assign(
      var,
      generator.getModel().ref(ValueHolderHelper.class).staticInvoke("getNullableIntervalDayHolder").arg(dayLiteral)
          .arg(millisLiteral));
  return new HoldingContainer(completeType, var, var.ref("value"), var.ref("isSet"));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:16,代碼來源:EvaluationVisitor.java

示例5: declare

import com.sun.codemodel.JVar; //導入方法依賴的package包/類
public HoldingContainer declare(CompleteType t, boolean includeNewInstance) {
  JType holderType = t.getHolderType(model);
  JVar var;
  if (includeNewInstance) {
    var = getEvalBlock().decl(holderType, "out" + index, JExpr._new(holderType));
  } else {
    var = getEvalBlock().decl(holderType, "out" + index);
  }
  index++;
  return new HoldingContainer(t, var, var.ref("value"), var.ref("isSet"));
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:12,代碼來源:ClassGenerator.java


注:本文中的com.sun.codemodel.JVar.ref方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。