本文整理汇总了Java中com.apple.internal.jobjc.generator.model.Function类的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Function类属于com.apple.internal.jobjc.generator.model包,在下文中一共展示了Function类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFieldCache
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:FunctionGenerator.java
示例2: createLocalNew
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:FunctionGenerator.java
示例3: makeInstanceName
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static String makeInstanceName(Function fxn){
String ext;
if(fxn instanceof Method){
if(((Method) fxn).isClassMethod) ext = "CMetInst";
else ext = "IMetInst";
}
else
ext = "FxnInst";
return fxn.getJavaName() + "_" + ext;
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:FunctionGenerator.java
示例4: createLocalForward
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static String createLocalForward(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
return new JLField("final", type.getCanonicalName(), identifier, new JLCall("get_" + identifier)).toString();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:FunctionGenerator.java
示例5: coreType
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static Class<? extends Invoke> coreType(final Function fxn){
return fxn instanceof Method ? MsgSend.class : FunCall.class;
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:FunctionGenerator.java
示例6: firstArg
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
private static String firstArg(Function fxn){
return fxn instanceof Method ? "getRuntime()" : "this";
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:FunctionGenerator.java
示例7: disambiguateFunctionsInFramework
import com.apple.internal.jobjc.generator.model.Function; //导入依赖的package包/类
static void disambiguateFunctionsInFramework(final Framework framework) {
for (final Function fxn : framework.functions)
fxn.disambiguateArgs();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:MethodDisambiguator.java
注:本文中的com.apple.internal.jobjc.generator.model.Function类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论