public class SingletonType extends ObjectType implements java.io.Externalizable
Type.NeverReturns
flags
boolean_ctype, boolean_type, booleanType, booleanValue_method, byte_type, byteType, char_type, charType, clone_method, double_type, doubleType, doubleValue_method, errorType, float_type, floatType, floatValue_method, int_type, intType, intValue_method, java_lang_Class_type, javalangannotationAnnotationType, javalangBooleanType, javalangCharacterType, javalangClassType, javalanginvokeMethodHandleType, javalangNumberType, javalangObjectType, javalangStringType, javalangThrowableType, long_type, longType, longValue_method, neverReturnsType, nullType, number_type, objectType, pointer_type, reflectClass, short_type, shortType, string_type, throwable_type, toString_method, tostring_type, toStringType, typeArray0, void_type, voidType
Constructor and Description |
---|
SingletonType(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
coerceFromObject(java.lang.Object obj)
Convert an object to a value of this Type.
|
static java.lang.Object |
coerceToSingleton(java.lang.Object obj) |
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 (in given method) cast from Object to this Type.
|
Type |
getImplementationType()
Return Java-level implementation type.
|
static SingletonType |
getInstance() |
java.lang.Class |
getReflectClass()
Get the java.lang.Class object for the representation type.
|
boolean |
isInstance(java.lang.Object obj) |
void |
readExternal(java.io.ObjectInput in) |
java.lang.Object |
readResolve() |
static SingletonType |
valueOf() |
void |
writeExternal(java.io.ObjectOutput out) |
getContextClass, getContextClassLoader, getField, getInterfaces, getInternalName, getMethod, getMethods, getMethods, getSuperclass, isExisting, setExisting
coerceToObject, emitCoerceToObject, emitConvertFromPrimitive, emitIsInstance, getGenericSignature, getMaybeGenericSignature, getName, getRawType, getRealType, getSignature, getSize, getSizeInWords, getType, hashCode, isCompatibleWithValue, isCompatibleWithValue, isInterface, isMoreSpecific, isSame, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSharedType, lowestCommonSuperType, make, make, printSignature, promote, promoteIfUnsigned, registerTypeForClass, setGenericSignature, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResult, toString
public static final SingletonType getInstance()
public static final SingletonType valueOf()
public java.lang.Class getReflectClass()
ObjectType
getReflectClass
in class ObjectType
public Type getImplementationType()
Type
getImplementationType
in class Type
public int compare(Type other)
Type
compare
in class ObjectType
public static java.lang.Object coerceToSingleton(java.lang.Object obj)
public java.lang.Object coerceFromObject(java.lang.Object obj)
Type
coerceFromObject
in class ObjectType
public void emitCoerceFromObject(CodeAttr code)
ObjectType
emitCoerceFromObject
in class ObjectType
public boolean isInstance(java.lang.Object obj)
isInstance
in class ObjectType
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException