79 * @param t1 the first type |
79 * @param t1 the first type |
80 * @param t2 the second type |
80 * @param t2 the second type |
81 * @return {@code true} if and only if the first type is a subtype |
81 * @return {@code true} if and only if the first type is a subtype |
82 * of the second |
82 * of the second |
83 * @throws IllegalArgumentException if given an executable or package type |
83 * @throws IllegalArgumentException if given an executable or package type |
84 * @jls3 4.10 Subtyping |
84 * @jls 4.10 Subtyping |
85 */ |
85 */ |
86 boolean isSubtype(TypeMirror t1, TypeMirror t2); |
86 boolean isSubtype(TypeMirror t1, TypeMirror t2); |
87 |
87 |
88 /** |
88 /** |
89 * Tests whether one type is assignable to another. |
89 * Tests whether one type is assignable to another. |
91 * @param t1 the first type |
91 * @param t1 the first type |
92 * @param t2 the second type |
92 * @param t2 the second type |
93 * @return {@code true} if and only if the first type is assignable |
93 * @return {@code true} if and only if the first type is assignable |
94 * to the second |
94 * to the second |
95 * @throws IllegalArgumentException if given an executable or package type |
95 * @throws IllegalArgumentException if given an executable or package type |
96 * @jls3 5.2 Assignment Conversion |
96 * @jls 5.2 Assignment Conversion |
97 */ |
97 */ |
98 boolean isAssignable(TypeMirror t1, TypeMirror t2); |
98 boolean isAssignable(TypeMirror t1, TypeMirror t2); |
99 |
99 |
100 /** |
100 /** |
101 * Tests whether one type argument <i>contains</i> another. |
101 * Tests whether one type argument <i>contains</i> another. |
102 * |
102 * |
103 * @param t1 the first type |
103 * @param t1 the first type |
104 * @param t2 the second type |
104 * @param t2 the second type |
105 * @return {@code true} if and only if the first type contains the second |
105 * @return {@code true} if and only if the first type contains the second |
106 * @throws IllegalArgumentException if given an executable or package type |
106 * @throws IllegalArgumentException if given an executable or package type |
107 * @jls3 4.5.1.1 Type Argument Containment and Equivalence |
107 * @jls 4.5.1.1 Type Argument Containment and Equivalence |
108 */ |
108 */ |
109 boolean contains(TypeMirror t1, TypeMirror t2); |
109 boolean contains(TypeMirror t1, TypeMirror t2); |
110 |
110 |
111 /** |
111 /** |
112 * Tests whether the signature of one method is a <i>subsignature</i> |
112 * Tests whether the signature of one method is a <i>subsignature</i> |
114 * |
114 * |
115 * @param m1 the first method |
115 * @param m1 the first method |
116 * @param m2 the second method |
116 * @param m2 the second method |
117 * @return {@code true} if and only if the first signature is a |
117 * @return {@code true} if and only if the first signature is a |
118 * subsignature of the second |
118 * subsignature of the second |
119 * @jls3 8.4.2 Method Signature |
119 * @jls 8.4.2 Method Signature |
120 */ |
120 */ |
121 boolean isSubsignature(ExecutableType m1, ExecutableType m2); |
121 boolean isSubsignature(ExecutableType m1, ExecutableType m2); |
122 |
122 |
123 /** |
123 /** |
124 * Returns the direct supertypes of a type. The interface types, if any, |
124 * Returns the direct supertypes of a type. The interface types, if any, |
134 * Returns the erasure of a type. |
134 * Returns the erasure of a type. |
135 * |
135 * |
136 * @param t the type to be erased |
136 * @param t the type to be erased |
137 * @return the erasure of the given type |
137 * @return the erasure of the given type |
138 * @throws IllegalArgumentException if given a package type |
138 * @throws IllegalArgumentException if given a package type |
139 * @jls3 4.6 Type Erasure |
139 * @jls 4.6 Type Erasure |
140 */ |
140 */ |
141 TypeMirror erasure(TypeMirror t); |
141 TypeMirror erasure(TypeMirror t); |
142 |
142 |
143 /** |
143 /** |
144 * Returns the class of a boxed value of a given primitive type. |
144 * Returns the class of a boxed value of a given primitive type. |
145 * That is, <i>boxing conversion</i> is applied. |
145 * That is, <i>boxing conversion</i> is applied. |
146 * |
146 * |
147 * @param p the primitive type to be converted |
147 * @param p the primitive type to be converted |
148 * @return the class of a boxed value of type {@code p} |
148 * @return the class of a boxed value of type {@code p} |
149 * @jls3 5.1.7 Boxing Conversion |
149 * @jls 5.1.7 Boxing Conversion |
150 */ |
150 */ |
151 TypeElement boxedClass(PrimitiveType p); |
151 TypeElement boxedClass(PrimitiveType p); |
152 |
152 |
153 /** |
153 /** |
154 * Returns the type (a primitive type) of unboxed values of a given type. |
154 * Returns the type (a primitive type) of unboxed values of a given type. |
156 * |
156 * |
157 * @param t the type to be unboxed |
157 * @param t the type to be unboxed |
158 * @return the type of an unboxed value of type {@code t} |
158 * @return the type of an unboxed value of type {@code t} |
159 * @throws IllegalArgumentException if the given type has no |
159 * @throws IllegalArgumentException if the given type has no |
160 * unboxing conversion |
160 * unboxing conversion |
161 * @jls3 5.1.8 Unboxing Conversion |
161 * @jls 5.1.8 Unboxing Conversion |
162 */ |
162 */ |
163 PrimitiveType unboxedType(TypeMirror t); |
163 PrimitiveType unboxedType(TypeMirror t); |
164 |
164 |
165 /** |
165 /** |
166 * Applies capture conversion to a type. |
166 * Applies capture conversion to a type. |
167 * |
167 * |
168 * @param t the type to be converted |
168 * @param t the type to be converted |
169 * @return the result of applying capture conversion |
169 * @return the result of applying capture conversion |
170 * @throws IllegalArgumentException if given an executable or package type |
170 * @throws IllegalArgumentException if given an executable or package type |
171 * @jls3 5.1.10 Capture Conversion |
171 * @jls 5.1.10 Capture Conversion |
172 */ |
172 */ |
173 TypeMirror capture(TypeMirror t); |
173 TypeMirror capture(TypeMirror t); |
174 |
174 |
175 /** |
175 /** |
176 * Returns a primitive type. |
176 * Returns a primitive type. |