108 public TypeTag getTag() { |
108 public TypeTag getTag() { |
109 return tag; |
109 return tag; |
110 } |
110 } |
111 |
111 |
112 public boolean isNumeric() { |
112 public boolean isNumeric() { |
113 switch (tag) { |
113 return tag.isNumeric; |
114 case BYTE: case CHAR: |
|
115 case SHORT: |
|
116 case INT: case LONG: |
|
117 case FLOAT: case DOUBLE: |
|
118 return true; |
|
119 default: |
|
120 return false; |
|
121 } |
|
122 } |
114 } |
123 |
115 |
124 public boolean isPrimitive() { |
116 public boolean isPrimitive() { |
125 return (isNumeric() || tag == BOOLEAN); |
117 return tag.isPrimitive; |
126 } |
118 } |
127 |
119 |
128 public boolean isPrimitiveOrVoid() { |
120 public boolean isPrimitiveOrVoid() { |
129 return (isPrimitive() || tag == VOID); |
121 return tag.isPrimitiveOrVoid; |
130 } |
122 } |
131 |
123 |
132 public boolean isReference() { |
124 public boolean isReference() { |
133 switch (tag) { |
125 return tag.isReference; |
134 case CLASS: |
|
135 case ARRAY: |
|
136 case TYPEVAR: |
|
137 case WILDCARD: |
|
138 case ERROR: |
|
139 return true; |
|
140 default: |
|
141 return false; |
|
142 } |
|
143 } |
126 } |
144 |
127 |
145 public boolean isNullOrReference() { |
128 public boolean isNullOrReference() { |
146 return (tag == BOT || isReference()); |
129 return (tag.isReference || tag == BOT); |
147 } |
130 } |
148 |
131 |
149 public boolean isPartial() { |
132 public boolean isPartial() { |
150 switch(tag) { |
133 return tag.isPartial; |
151 case ERROR: case UNKNOWN: case UNDETVAR: |
|
152 return true; |
|
153 default: |
|
154 return false; |
|
155 } |
|
156 } |
134 } |
157 |
135 |
158 /** |
136 /** |
159 * The constant value of this type, null if this type does not |
137 * The constant value of this type, null if this type does not |
160 * have a constant value attribute. Only primitive types and |
138 * have a constant value attribute. Only primitive types and |