当前位置: 首页>>代码示例>>Java>>正文


Java ParameterKind类代码示例

本文整理汇总了Java中com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind的典型用法代码示例。如果您正苦于以下问题:Java ParameterKind类的具体用法?Java ParameterKind怎么用?Java ParameterKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ParameterKind类属于com.sun.tools.javac.tree.JCTree.JCLambda包,在下文中一共展示了ParameterKind类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitLambda

import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
@Override
public void visitLambda(JCLambda that) {
    if (that.paramKind == ParameterKind.EXPLICIT) {
        //if lambda is explicit, we can save info in the corresponding argument type
        processArg(that, () -> {
            JCLambda speculativeLambda =
                    deferredAttr.attribSpeculativeLambda(that, env, attr.methodAttrInfo);
            return new ExplicitLambdaType(that, env, speculativeLambda);
        });
    } else {
        //otherwise just use a deferred type
        setResult(that, deferredAttr.new DeferredType(that, env));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:ArgumentAttr.java

示例2: visitLambdaExpression

import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public JCTree visitLambdaExpression(LambdaExpressionTree node, Void _unused) {
    JCLambda oldLambda = (JCLambda)node;
    JCLambda newLambda = (JCLambda)super.visitLambdaExpression(node, _unused);
    if (oldLambda.paramKind == ParameterKind.IMPLICIT) {
        //reset implicit lambda parameters (whose type might have been set during attr)
        newLambda.paramKind = ParameterKind.IMPLICIT;
        newLambda.params.forEach(p -> p.vartype = null);
    }
    return newLambda;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:Analyzer.java

示例3: inlineParams

import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
public List<JCVariableDecl> inlineParams(Inliner inliner) throws CouldNotResolveImportException {
  if (parameterKind() == ParameterKind.EXPLICIT) {
    return List.convert(JCVariableDecl.class, inliner.inlineList(getParameters()));
  }
  ListBuffer<JCVariableDecl> params = new ListBuffer<>();
  for (UVariableDecl param : getParameters()) {
    params.add(param.inlineImplicitType(inliner));
  }
  return params.toList();
}
 
开发者ID:google,项目名称:error-prone,代码行数:11,代码来源:ULambda.java

示例4: create

import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
public static ULambda create(
    ParameterKind parameterKind, Iterable<UVariableDecl> parameters, UTree<?> body) {
  return new AutoValue_ULambda(parameterKind, ImmutableList.copyOf(parameters), body);
}
 
开发者ID:google,项目名称:error-prone,代码行数:5,代码来源:ULambda.java

示例5: parameterKind

import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
abstract ParameterKind parameterKind(); 
开发者ID:google,项目名称:error-prone,代码行数:2,代码来源:ULambda.java


注:本文中的com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。