1 /*
2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
120 /**
121 * A wildcard type argument.
122 */
123 WILDCARD,
124
125 /**
126 * A pseudo-type corresponding to a package element.
127 * @see NoType
128 */
129 PACKAGE,
130
131 /**
132 * A method, constructor, or initializer.
133 */
134 EXECUTABLE,
135
136 /**
137 * An implementation-reserved type.
138 * This is not the type you are looking for.
139 */
140 OTHER;
141
142 /**
143 * Returns {@code true} if this kind corresponds to a primitive
144 * type and {@code false} otherwise.
145 * @return {@code true} if this kind corresponds to a primitive type
146 */
147 public boolean isPrimitive() {
148 switch(this) {
149 case BOOLEAN:
150 case BYTE:
151 case SHORT:
152 case INT:
153 case LONG:
154 case CHAR:
155 case FLOAT:
156 case DOUBLE:
157 return true;
158
159 default:
160 return false;
|
1 /*
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
120 /**
121 * A wildcard type argument.
122 */
123 WILDCARD,
124
125 /**
126 * A pseudo-type corresponding to a package element.
127 * @see NoType
128 */
129 PACKAGE,
130
131 /**
132 * A method, constructor, or initializer.
133 */
134 EXECUTABLE,
135
136 /**
137 * An implementation-reserved type.
138 * This is not the type you are looking for.
139 */
140 OTHER,
141
142 /**
143 * A disjunctive type.
144 *
145 * @since 1.7
146 */
147 DISJUNCTIVE;
148
149 /**
150 * Returns {@code true} if this kind corresponds to a primitive
151 * type and {@code false} otherwise.
152 * @return {@code true} if this kind corresponds to a primitive type
153 */
154 public boolean isPrimitive() {
155 switch(this) {
156 case BOOLEAN:
157 case BYTE:
158 case SHORT:
159 case INT:
160 case LONG:
161 case CHAR:
162 case FLOAT:
163 case DOUBLE:
164 return true;
165
166 default:
167 return false;
|