objecttype.java

来自「这是一个Linux下的集成开发环境」· Java 代码 · 共 54 行

JAVA
54
字号
package gnu.bytecode;/**  * Abstract class object reference types.  * <p>  * Extended by ClassType and ArrayType. */public abstract class ObjectType extends Type{  public ObjectType ()  {    size = 4;  }  public abstract String getNameOrSignature();  /** Get the java.lang.Class object for the representation type. */  public Class getReflectClass()  {    try      {	if (reflectClass == null)	  reflectClass = Class.forName(getNameOrSignature());      }    catch (java.lang.ClassNotFoundException ex)      {      }    return reflectClass;  }  /** Convert an object to a value of this Type.   * Throw a ClassCastException when this is not possible. */  public Object coerceFromObject (Object obj)  {    if (this == Type.string_type)      return obj.toString();    if (getReflectClass().isAssignableFrom(obj.getClass()))      return obj;    throw new ClassCastException("don't know how to coerce "				 + obj.getClass().getName() + " to "				 + getName());  }  /** Compile (in given method) cast from Object to this Type. */  public void emitCoerceFromObject (CodeAttr code)  {    if (this == Type.string_type)      code.emitInvokeVirtual(Type.toString_method);    else if (this != Type.pointer_type)      code.emitCheckcast(this);  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?