本文整理汇总了Java中com.sun.tools.hat.internal.util.Misc.toHex方法的典型用法代码示例。如果您正苦于以下问题:Java Misc.toHex方法的具体用法?Java Misc.toHex怎么用?Java Misc.toHex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.hat.internal.util.Misc
的用法示例。
在下文中一共展示了Misc.toHex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dereference
import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
public JavaThing dereference(Snapshot snapshot, JavaField field, boolean verbose) {
if (field != null && !field.hasId()) {
// If this happens, we must be a field that represents an int.
// (This only happens with .bod-style files)
return new JavaLong(id);
}
if (id == 0) {
return snapshot.getNullThing();
}
JavaThing result = snapshot.findThing(id);
if (result == null) {
if (!snapshot.getUnresolvedObjectsOK() && verbose) {
String msg = "WARNING: Failed to resolve object id "
+ Misc.toHex(id);
if (field != null) {
msg += " for field " + field.getName()
+ " (signature " + field.getSignature() + ")";
}
System.out.println(msg);
// Thread.dumpStack();
}
result = new HackJavaValue("Unresolved object "
+ Misc.toHex(id), 0);
}
return result;
}
示例2: addFakeInstanceClass
import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
JavaClass addFakeInstanceClass(long classID, int instSize) {
// Create a fake class name based on ID.
String name = "unknown-class<@" + Misc.toHex(classID) + ">";
// Create fake fields convering the given instance size.
// Create as many as int type fields and for the left over
// size create byte type fields.
int numInts = instSize / 4;
int numBytes = instSize % 4;
JavaField[] fields = new JavaField[numInts + numBytes];
int i;
for (i = 0; i < numInts; i++) {
fields[i] = new JavaField("unknown-field-" + i, "I");
}
for (i = 0; i < numBytes; i++) {
fields[i + numInts] = new JavaField("unknown-field-" +
i + numInts, "B");
}
// Create fake instance class
JavaClass c = new JavaClass(name, 0, 0, 0, 0, fields,
EMPTY_STATIC_ARRAY, instSize);
// Add the class
addFakeClass(makeId(classID), c);
return c;
}
示例3: getIdString
import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
public String getIdString() {
return Misc.toHex(id);
}
示例4: toString
import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
public String toString() {
return "Unresolved object " + Misc.toHex(id);
}
示例5: getIdString
import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
/**
* @return the id of this thing as hex string
*/
public String getIdString() {
return Misc.toHex(getId());
}