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


Java Misc.toHex方法代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:JavaObjectRef.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:Snapshot.java

示例3: getIdString

import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
public String getIdString() {
    return Misc.toHex(id);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:Root.java

示例4: toString

import com.sun.tools.hat.internal.util.Misc; //导入方法依赖的package包/类
public String toString() {
    return "Unresolved object " + Misc.toHex(id);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:JavaObjectRef.java

示例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());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:JavaHeapObject.java


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