gnu.bytecode
public abstract class Type extends Object
| Field Summary | |
|---|---|
| static Method | booleanValue_method |
| static ClassType | boolean_ctype |
| static PrimType | boolean_type |
| static PrimType | byte_type |
| static PrimType | char_type |
| static Method | clone_method |
| static Method | doubleValue_method |
| static PrimType | double_type |
| static Method | floatValue_method |
| static PrimType | float_type |
| static Method | intValue_method |
| static PrimType | int_type |
| static ClassType | java_lang_Class_type |
| static Method | longValue_method |
| static PrimType | long_type |
| static PrimType | neverReturnsType The "return type" of an expression that never returns, such as a throw. |
| static ObjectType | nullType The magic type of null. |
| static ClassType | number_type |
| static ClassType | pointer_type |
| protected Class | reflectClass |
| static PrimType | short_type |
| static ClassType | string_type |
| static ClassType | throwable_type |
| static ClassType | tostring_type |
| static Method | toString_method |
| static Type[] | typeArray0 |
| static PrimType | void_type |
| Constructor Summary | |
|---|---|
| protected | Type() |
| Type(Type type) | |
| Method Summary | |
|---|---|
| abstract Object | coerceFromObject(Object obj) Convert an object to a value of this Type.
|
| Object | coerceToObject(Object obj) |
| abstract int | compare(Type other) Return a numeric code showing "subtype" relationship:
1: if other is a pure subtype of this;
0: if has the same values;
-1: if this is a pure subtype of other;
-2: if they have values in common but neither is a subtype of the other;
-3: if the types have no values in common.
|
| void | emitCoerceFromObject(CodeAttr code) Compile code to coerce/convert from Object to this type. |
| void | emitCoerceToObject(CodeAttr code) Compile code to convert a object of this type on the stack to Object. |
| void | emitIsInstance(CodeAttr code) |
| Type | getImplementationType() The type used to implement types not natively understood by the JVM.
|
| String | getName() |
| Class | getReflectClass() Get the java.lang.Class object for the representation type. |
| String | getSignature() |
| int | getSize() |
| int | getSizeInWords() |
| static Type | getType(String name) Find an Type with the given name, or create a new one.
|
| int | hashCode() |
| boolean | isInstance(Object obj) |
| static boolean | isMoreSpecific(Type[] t1, Type[] t2) Return true iff t1[i].isSubtype(t2[i]) for all i. |
| boolean | isSubtype(Type other) Return true if this is a "subtype" of other. |
| static boolean | isValidJavaTypeName(String name) |
| boolean | isVoid() |
| static Type | lookupType(String name) |
| static Type | lowestCommonSuperType(Type t1, Type t2)
Computes the common supertype
Interfaces are not taken into account.
|
| static Type | make(Class reflectClass) |
| Type | promote() |
| static void | registerTypeForClass(Class clas, Type type) Register that the Type for class is type. |
| protected void | setName(String name) |
| void | setReflectClass(Class rclass) |
| protected void | setSignature(String sig) |
| static int | signatureLength(String sig, int pos) Return the length of the signature starting at a given string position.
|
| static int | signatureLength(String sig) |
| static String | signatureToName(String sig) Returns the Java-level type name from a given signature.
|
| static PrimType | signatureToPrimitive(char sig) Returns the primitive type corresponding to a signature character. |
| static Type | signatureToType(String sig, int off, int len) Get a Type corresponding to the given signature string. |
| static Type | signatureToType(String sig) Get a Type corresponding to the given signature string. |
| protected static int | swappedCompareResult(int code) Change result from compare to compensate for argument swapping. |
| String | toString() |
Parameters: name the name of the class (e..g. "java.lang.String").
Returns: the lowest type that is both above t1 and t2, or null if t1 and t2 have no common supertype.
Returns: a primitive type, or null if there is no such type.