duke@1: /* darcy@851: * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@554: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. duke@1: */ duke@1: duke@1: package javax.lang.model.type; duke@1: duke@1: duke@1: /** duke@1: * The kind of a type mirror. duke@1: * duke@1: *

Note that it is possible additional type kinds will be added to duke@1: * accommodate new, currently unknown, language structures added to duke@1: * future versions of the Java™ programming language. duke@1: * duke@1: * @author Joseph D. Darcy duke@1: * @author Scott Seligman duke@1: * @author Peter von der Ahé duke@1: * @see TypeMirror duke@1: * @since 1.6 duke@1: */ duke@1: public enum TypeKind { duke@1: /** duke@1: * The primitive type {@code boolean}. duke@1: */ duke@1: BOOLEAN, duke@1: duke@1: /** duke@1: * The primitive type {@code byte}. duke@1: */ duke@1: BYTE, duke@1: duke@1: /** duke@1: * The primitive type {@code short}. duke@1: */ duke@1: SHORT, duke@1: duke@1: /** duke@1: * The primitive type {@code int}. duke@1: */ duke@1: INT, duke@1: duke@1: /** duke@1: * The primitive type {@code long}. duke@1: */ duke@1: LONG, duke@1: duke@1: /** duke@1: * The primitive type {@code char}. duke@1: */ duke@1: CHAR, duke@1: duke@1: /** duke@1: * The primitive type {@code float}. duke@1: */ duke@1: FLOAT, duke@1: duke@1: /** duke@1: * The primitive type {@code double}. duke@1: */ duke@1: DOUBLE, duke@1: duke@1: /** duke@1: * The pseudo-type corresponding to the keyword {@code void}. duke@1: * @see NoType duke@1: */ duke@1: VOID, duke@1: duke@1: /** duke@1: * A pseudo-type used where no actual type is appropriate. duke@1: * @see NoType duke@1: */ duke@1: NONE, duke@1: duke@1: /** duke@1: * The null type. duke@1: */ duke@1: NULL, duke@1: duke@1: /** duke@1: * An array type. duke@1: */ duke@1: ARRAY, duke@1: duke@1: /** duke@1: * A class or interface type. duke@1: */ duke@1: DECLARED, duke@1: duke@1: /** duke@1: * A class or interface type that could not be resolved. duke@1: */ duke@1: ERROR, duke@1: duke@1: /** duke@1: * A type variable. duke@1: */ duke@1: TYPEVAR, duke@1: duke@1: /** duke@1: * A wildcard type argument. duke@1: */ duke@1: WILDCARD, duke@1: duke@1: /** duke@1: * A pseudo-type corresponding to a package element. duke@1: * @see NoType duke@1: */ duke@1: PACKAGE, duke@1: duke@1: /** duke@1: * A method, constructor, or initializer. duke@1: */ duke@1: EXECUTABLE, duke@1: duke@1: /** duke@1: * An implementation-reserved type. duke@1: * This is not the type you are looking for. duke@1: */ darcy@851: OTHER, darcy@851: darcy@851: /** darcy@969: * A union type. darcy@851: * darcy@851: * @since 1.7 darcy@851: */ darcy@969: UNION; duke@1: duke@1: /** duke@1: * Returns {@code true} if this kind corresponds to a primitive duke@1: * type and {@code false} otherwise. duke@1: * @return {@code true} if this kind corresponds to a primitive type duke@1: */ duke@1: public boolean isPrimitive() { duke@1: switch(this) { duke@1: case BOOLEAN: duke@1: case BYTE: duke@1: case SHORT: duke@1: case INT: duke@1: case LONG: duke@1: case CHAR: duke@1: case FLOAT: duke@1: case DOUBLE: duke@1: return true; duke@1: duke@1: default: duke@1: return false; duke@1: } duke@1: } duke@1: }