88 * Initializes this type. 89 */ 90 void initialize(); 91 92 /** 93 * Checks whether this type is linked and verified. When a type is linked the static initializer 94 * has not necessarily run. An {@link #isInitialized() initialized} type is always linked. 95 * 96 * @return {@code true} if this type is linked 97 */ 98 boolean isLinked(); 99 100 /** 101 * Determines if this type is either the same as, or is a superclass or superinterface of, the 102 * type represented by the specified parameter. This method is identical to 103 * {@link Class#isAssignableFrom(Class)} in terms of the value return for this type. 104 */ 105 boolean isAssignableFrom(ResolvedJavaType other); 106 107 /** 108 * Returns true if this type is exactly the type {@link java.lang.Object}. 109 */ 110 default boolean isJavaLangObject() { 111 // Removed assertion due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434442 112 return getSuperclass() == null && !isInterface() && getJavaKind() == JavaKind.Object; 113 } 114 115 /** 116 * Checks whether the specified object is an instance of this type. 117 * 118 * @param obj the object to test 119 * @return {@code true} if the object is an instance of this type 120 */ 121 boolean isInstance(JavaConstant obj); 122 123 /** 124 * Gets the super class of this type. If this type represents either the {@code Object} class, 125 * an interface, a primitive type, or void, then null is returned. If this object represents an 126 * array class then the type object representing the {@code Object} class is returned. 127 */ | 88 * Initializes this type. 89 */ 90 void initialize(); 91 92 /** 93 * Checks whether this type is linked and verified. When a type is linked the static initializer 94 * has not necessarily run. An {@link #isInitialized() initialized} type is always linked. 95 * 96 * @return {@code true} if this type is linked 97 */ 98 boolean isLinked(); 99 100 /** 101 * Determines if this type is either the same as, or is a superclass or superinterface of, the 102 * type represented by the specified parameter. This method is identical to 103 * {@link Class#isAssignableFrom(Class)} in terms of the value return for this type. 104 */ 105 boolean isAssignableFrom(ResolvedJavaType other); 106 107 /** 108 * Returns the {@link ResolvedJavaType} object representing the host class of this VM anonymous 109 * class (as opposed to the unrelated concept specified by {@link Class#isAnonymousClass()}) or 110 * {@code null} if this object does not represent a VM anonymous class. 111 */ 112 ResolvedJavaType getHostClass(); 113 114 /** 115 * Returns true if this type is exactly the type {@link java.lang.Object}. 116 */ 117 default boolean isJavaLangObject() { 118 // Removed assertion due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434442 119 return getSuperclass() == null && !isInterface() && getJavaKind() == JavaKind.Object; 120 } 121 122 /** 123 * Checks whether the specified object is an instance of this type. 124 * 125 * @param obj the object to test 126 * @return {@code true} if the object is an instance of this type 127 */ 128 boolean isInstance(JavaConstant obj); 129 130 /** 131 * Gets the super class of this type. If this type represents either the {@code Object} class, 132 * an interface, a primitive type, or void, then null is returned. If this object represents an 133 * array class then the type object representing the {@code Object} class is returned. 134 */ |