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


Java Misc类代码示例

本文整理汇总了Java中com.sun.tools.hat.internal.util.Misc的典型用法代码示例。如果您正苦于以下问题:Java Misc类的具体用法?Java Misc怎么用?Java Misc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Misc类属于com.sun.tools.hat.internal.util包,在下文中一共展示了Misc类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: printHex

import com.sun.tools.hat.internal.util.Misc; //导入依赖的package包/类
protected void printHex(long addr) {
    if (snapshot.getIdentifierSize() == 4) {
        out.print(Misc.toHex((int)addr));
    } else {
        out.print(Misc.toHex(addr));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:QueryHandler.java

示例4: getIdString

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

示例5: 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

示例6: findThing

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

示例7: 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

示例8: parseHex

import com.sun.tools.hat.internal.util.Misc; //导入依赖的package包/类
protected long parseHex(String value) {
    return Misc.parseHex(value);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:QueryHandler.java

示例9: print

import com.sun.tools.hat.internal.util.Misc; //导入依赖的package包/类
protected void print(String str) {
    out.print(Misc.encodeHtml(str));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:QueryHandler.java

示例10: println

import com.sun.tools.hat.internal.util.Misc; //导入依赖的package包/类
protected void println(String str) {
    out.println(Misc.encodeHtml(str));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:QueryHandler.java


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