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


Java Map1类代码示例

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


Map1类属于com.apple.internal.jobjc.generator.utils.Fp包,在下文中一共展示了Map1类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _resolve

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:StructOffsetResolver.java

示例2: _resolve

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:StructOffsetResolverBigBang.java

示例3: writeBeginning

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:27,代码来源:StructClassFile.java

示例4: execute

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
protected void execute(String executable, Fp.Map1<String,Object> lineProcessor) throws Exception {
//        System.out.println(">>>> Executing " + new Date().toString());
        Process p = Runtime.getRuntime().exec(new String[]{executable});

        if(lineProcessor != null){
            BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line;
            while ((line = stdout.readLine()) != null)
                lineProcessor.apply(line);
            stdout.close();
        }
        p.waitFor();
        if(p.exitValue() != 0)
            throw new RuntimeException(executable + " did not execute successfully: " + p.exitValue());
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:StructOffsetResolver.java

示例5: parseDependencies

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
public void parseDependencies(final Collection<Framework> frameworks) {
    // Parse
    dependencies = getNodesFor(rootNode, "depends_on", FrameworkDependency.class, this);
    // Resolve
    for(final FrameworkDependency dep : dependencies)
        dep.object = Fp.find(new Map1<Framework,Boolean>(){
            public Boolean apply(Framework f) {
                return f.path.equals(dep.path);
            }}, frameworks);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:Framework.java

示例6: parseClasses

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
public void parseClasses() {
    classes = new HashSet<Clazz>(getNodesFor(rootNode, "class", Clazz.class, this));
    classes = Fp.filterSet(new Map1<Clazz,Boolean>(){
        public Boolean apply(Clazz a) {
            if(a.doesActuallyExist())
                return true;
            else{
                System.out.println("Could not find class " + name + ":" + a.name + " in runtime. Discarding.");
                return false;
            }
        }}, classes);
    informalProtocols = getNodesFor(rootNode, "informal_protocol", InformalProtocol.class, this);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:Framework.java

示例7: writeBeginning

import com.apple.internal.jobjc.generator.utils.Fp.Map1; //导入依赖的package包/类
@Override public void writeBeginning(final PrintStream out) {
    List<String> binPaths = Fp.map(new Map1<File,String>(){
        public String apply(File a) { return "\"" + a.getAbsolutePath() + "\""; }},
        framework.binaries);
    out.println(new Utils.Substituter(
            "#public " + className + "(" + JObjCRuntime.class.getName() + " runtime) {~" +
            "##super(runtime, new String[]{" + Fp.join(", ", binPaths) + "});~" +
            "#}~"
    ));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:FrameworkClassFile.java


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