99 * 100 * This method is undefined for primitive void type, which 101 * doesn't have any corresponding array representation. 102 * 103 * @return A {@link JClass} representing the array type 104 * whose element type is this type 105 */ 106 public abstract JClass array(); 107 108 /** Tell whether or not this is an array type. */ 109 public boolean isArray() { 110 return false; 111 } 112 113 /** Tell whether or not this is a built-in primitive type, such as int or void. */ 114 public boolean isPrimitive() { 115 return false; 116 } 117 118 /** 119 * If this class is a primitive type, return the boxed class. Otherwise return <tt>this</tt>. 120 * 121 * <p> 122 * For example, for "int", this method returns "java.lang.Integer". 123 */ 124 public abstract JClass boxify(); 125 126 /** 127 * If this class is a wrapper type for a primitive, return the primitive type. 128 * Otherwise return <tt>this</tt>. 129 * 130 * <p> 131 * For example, for "java.lang.Integer", this method returns "int". 132 */ 133 public abstract JType unboxify(); 134 135 /** 136 * Returns the erasure of this type. 137 */ 138 public JType erasure() { 139 return this; 140 } 141 142 /** 143 * Returns true if this is a referenced type. 144 */ 145 public final boolean isReference() { 146 return !isPrimitive(); 147 } 148 | 99 * 100 * This method is undefined for primitive void type, which 101 * doesn't have any corresponding array representation. 102 * 103 * @return A {@link JClass} representing the array type 104 * whose element type is this type 105 */ 106 public abstract JClass array(); 107 108 /** Tell whether or not this is an array type. */ 109 public boolean isArray() { 110 return false; 111 } 112 113 /** Tell whether or not this is a built-in primitive type, such as int or void. */ 114 public boolean isPrimitive() { 115 return false; 116 } 117 118 /** 119 * If this class is a primitive type, return the boxed class. 120 * Otherwise return {@code this}. 121 * 122 * <p> 123 * For example, for "int", this method returns "java.lang.Integer". 124 */ 125 public abstract JClass boxify(); 126 127 /** 128 * If this class is a wrapper type for a primitive, return the primitive type. 129 * Otherwise return {@code this}. 130 * 131 * <p> 132 * For example, for "java.lang.Integer", this method returns "int". 133 */ 134 public abstract JType unboxify(); 135 136 /** 137 * Returns the erasure of this type. 138 */ 139 public JType erasure() { 140 return this; 141 } 142 143 /** 144 * Returns true if this is a referenced type. 145 */ 146 public final boolean isReference() { 147 return !isPrimitive(); 148 } 149 |