本文整理汇总了Java中com.apple.internal.jobjc.generator.utils.NTypeMerger类的典型用法代码示例。如果您正苦于以下问题:Java NTypeMerger类的具体用法?Java NTypeMerger怎么用?Java NTypeMerger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NTypeMerger类属于com.apple.internal.jobjc.generator.utils包,在下文中一共展示了NTypeMerger类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: merge
import com.apple.internal.jobjc.generator.utils.NTypeMerger; //导入依赖的package包/类
public static Type merge(Type a, Type b) throws MergeFailed{
if(a!=null && b==null) return a;
if(a==null && b!=null) return b;
if(QA.bothNullOrEquals(a, b)) return a;
if (exceptions.containsKey(a.name)) return exceptions.get(a.name); // HACK BS bug
if(a.name != null && b.name != null && !a.name.equals(b.name)){
System.out.println("Merging:");
System.out.println("\ta.....: " + a.toString());
System.out.println("\tb.....: " + b.toString());
}
final Type merged = new Type(NTypeMerger.inst().mergeName(a.name, b.name),
NTypeMerger.inst().merge(a.type32, b.type32),
NTypeMerger.inst().merge(a.type64, b.type64));
if(a.name != null && b.name != null && !a.name.equals(b.name)){
System.out.println("\tmerged: " + merged.toString());
}
return merged;
}
示例2: testMerge
import com.apple.internal.jobjc.generator.utils.NTypeMerger; //导入依赖的package包/类
public void testMerge(){
NType a = doParse("{_NSRect={_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=ff}}");
NType b = doParse("{_NSRect=\"origin\"{_NSPoint=ff}{_NSSize=\"width\"f\"height\"f}}");
NType c = NTypeMerger.inst().merge(a, b);
NType expected = doParse("{_NSRect=\"origin\"{_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=\"width\"f\"height\"f}}");
System.out.println("Merge results:");
System.out.println("\ta: " + a.toString());
System.out.println("\tb: " + b.toString());
System.out.println("\tc: " + c.toString());
System.out.println("\tx: " + expected.toString());
assertEquals(expected, c);
}