本文整理汇总了Java中com.apple.internal.jobjc.generator.model.types.NType.NPointer类的典型用法代码示例。如果您正苦于以下问题:Java NPointer类的具体用法?Java NPointer怎么用?Java NPointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NPointer类属于com.apple.internal.jobjc.generator.model.types.NType包,在下文中一共展示了NPointer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accept
import com.apple.internal.jobjc.generator.model.types.NType.NPointer; //导入依赖的package包/类
protected JType accept(Type type, NPointer nt32, NPointer nt64){
final CFType cfType = TypeCache.inst().getCFTypeForName(type.name);
if(cfType != null) return new JCFType(cfType);
final Opaque opaque = TypeCache.inst().getOpaqueForName(type.name);
if(opaque != null) return new JOpaque(opaque);
if("void*".equals(type.name)) return JPointer.VOID_PTR;
if(type.name != null && type.name.endsWith("*")){
final String subDeclaredType = type.name.substring(0, type.name.length() - 1);
final Type subType = TypeCache.inst().getTypeByName(subDeclaredType);
if (subType == null) return new JUnknown(type);
// TODO Instead of JUnknown, VOID_PTR might be a good fallback. Investigate.
final JType javaType = TypeToJType.inst().getJTypeFor(subType).getParameterizableType();
final JPointer pointer = new JPointer(javaType);
return pointer;
}
return new JUnknown(type);
}
示例2: parse
import com.apple.internal.jobjc.generator.model.types.NType.NPointer; //导入依赖的package包/类
@Override protected NType parse(StringStream ss) {
if(ss.peek() == '*'){
ss.eat('*');
return CHAR_PTR;
}
else{
ss.eat('^');
return new NPointer(NTypeParser.parseFrom(ss));
}
}
示例3: accept
import com.apple.internal.jobjc.generator.model.types.NType.NPointer; //导入依赖的package包/类
protected NType accept(NPointer a, NPointer b) {
return new NPointer(NTypeMerger.inst().merge(a.subject, b.subject));
}
示例4: accept
import com.apple.internal.jobjc.generator.model.types.NType.NPointer; //导入依赖的package包/类
protected String accept(NPointer nt) {
if(nt.subject instanceof NPrimitive && ((NPrimitive) nt.subject).type == 'C')
return "*";
else
return "^" + print(nt.subject);
}