本文整理汇总了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));
}
}
示例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;
}
示例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();
}
示例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);
}
示例5: parameterKind
import com.sun.tools.javac.tree.JCTree.JCLambda.ParameterKind; //导入依赖的package包/类
abstract ParameterKind parameterKind();