本文整理汇总了Java中com.android.dx.rop.type.Type.intern方法的典型用法代码示例。如果您正苦于以下问题:Java Type.intern方法的具体用法?Java Type.intern怎么用?Java Type.intern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.dx.rop.type.Type
的用法示例。
在下文中一共展示了Type.intern方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseAnnotation
import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/**
* Parses a single annotation.
*
* @param visibility {@code non-null;} visibility of the parsed annotation
* @return {@code non-null;} the parsed annotation
*/
private Annotation parseAnnotation(AnnotationVisibility visibility)
throws IOException {
requireLength(4);
int typeIndex = input.readUnsignedShort();
int numElements = input.readUnsignedShort();
CstString typeString = (CstString) pool.get(typeIndex);
CstType type = new CstType(Type.intern(typeString.getString()));
if (observer != null) {
parsed(2, "type: " + type.toHuman());
parsed(2, "num_elements: " + numElements);
}
Annotation annotation = new Annotation(type, visibility);
for (int i = 0; i < numElements; i++) {
if (observer != null) {
parsed(0, "elements[" + i + "]:");
changeIndent(1);
}
NameValuePair element = parseElement();
annotation.add(element);
if (observer != null) {
changeIndent(-1);
}
}
annotation.setImmutable();
return annotation;
}
示例2: getType
import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/**
* Gets the variable's type descriptor. This is a convenient shorthand
* for {@code Type.intern(getDescriptor().getString())}.
*
* @return {@code non-null;} the variable's type
*/
public Type getType() {
return Type.intern(descriptor.getString());
}
示例3: getFieldType
import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/**
* Gets the field type corresponding to this instance's descriptor.
* This method is only valid to call if the descriptor in fact describes
* a field (and not a method).
*
* @return {@code non-null;} the field type
*/
public Type getFieldType() {
return Type.intern(descriptor.getString());
}