duke@1: /* ohair@240: * Copyright (c) 1997, 2010, 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@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * 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@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: duke@1: package org.omg.CORBA; duke@1: duke@1: duke@1: /** duke@1: * The Java mapping of the IDL enum TCKind, which duke@1: * specifies the kind of a TypeCode object. There is duke@1: * one kind for each primitive and essential IDL data type. duke@1: *

duke@1: * The class TCKind consists of: duke@1: *

duke@1: *

The value field of a TCKind instance duke@1: * is the CDR encoding used for a TypeCode object in duke@1: * an IIOP message. duke@1: */ duke@1: duke@1: public class TCKind { duke@1: duke@1: /** duke@1: * The int constant for a null IDL data type. duke@1: */ duke@1: public static final int _tk_null = 0; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type void. duke@1: */ duke@1: public static final int _tk_void = 1; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type short. duke@1: */ duke@1: public static final int _tk_short = 2; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type long. duke@1: */ duke@1: public static final int _tk_long = 3; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type ushort. duke@1: */ duke@1: public static final int _tk_ushort = 4; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type ulong. duke@1: */ duke@1: public static final int _tk_ulong = 5; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type float. duke@1: */ duke@1: public static final int _tk_float = 6; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type double. duke@1: */ duke@1: public static final int _tk_double = 7; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type boolean. duke@1: */ duke@1: public static final int _tk_boolean = 8; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type char. duke@1: */ duke@1: public static final int _tk_char = 9; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type octet. duke@1: */ duke@1: public static final int _tk_octet = 10; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type any. duke@1: */ duke@1: public static final int _tk_any = 11; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type TypeCode. duke@1: */ duke@1: public static final int _tk_TypeCode = 12; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type Principal. duke@1: */ duke@1: public static final int _tk_Principal = 13; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type objref. duke@1: */ duke@1: public static final int _tk_objref = 14; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type struct. duke@1: */ duke@1: public static final int _tk_struct = 15; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type union. duke@1: */ duke@1: public static final int _tk_union = 16; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type enum. duke@1: */ duke@1: public static final int _tk_enum = 17; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type string. duke@1: */ duke@1: public static final int _tk_string = 18; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type sequence. duke@1: */ duke@1: public static final int _tk_sequence = 19; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type array. duke@1: */ duke@1: public static final int _tk_array = 20; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type alias. duke@1: */ duke@1: public static final int _tk_alias = 21; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type except. duke@1: */ duke@1: public static final int _tk_except = 22; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type longlong. duke@1: */ duke@1: public static final int _tk_longlong = 23; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type ulonglong. duke@1: */ duke@1: public static final int _tk_ulonglong = 24; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type longdouble. duke@1: */ duke@1: public static final int _tk_longdouble = 25; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type wchar. duke@1: */ duke@1: public static final int _tk_wchar = 26; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type wstring. duke@1: */ duke@1: public static final int _tk_wstring = 27; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type fixed. duke@1: */ duke@1: public static final int _tk_fixed = 28; duke@1: duke@1: /** duke@1: * The int constant for the IDL data type value. duke@1: */ duke@1: public static final int _tk_value = 29; // orbos 98-01-18: Objects By Value duke@1: duke@1: /** duke@1: * The int constant for the IDL data type value_box. duke@1: */ duke@1: public static final int _tk_value_box = 30; // orbos 98-01-18: Objects By Value duke@1: duke@1: /** duke@1: * The int constant for the IDL data type native. duke@1: */ duke@1: public static final int _tk_native = 31; // Verify duke@1: duke@1: /** duke@1: * The int constant for the IDL data type abstract interface. duke@1: */ duke@1: public static final int _tk_abstract_interface = 32; duke@1: duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_null. duke@1: */ duke@1: public static final TCKind tk_null = new TCKind(_tk_null); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_void. duke@1: */ duke@1: public static final TCKind tk_void = new TCKind(_tk_void); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_short. duke@1: */ duke@1: public static final TCKind tk_short = new TCKind(_tk_short); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_long. duke@1: */ duke@1: public static final TCKind tk_long = new TCKind(_tk_long); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_ushort. duke@1: */ duke@1: public static final TCKind tk_ushort = new TCKind(_tk_ushort); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_ulong. duke@1: */ duke@1: public static final TCKind tk_ulong = new TCKind(_tk_ulong); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_float. duke@1: */ duke@1: public static final TCKind tk_float = new TCKind(_tk_float); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_double. duke@1: */ duke@1: public static final TCKind tk_double = new TCKind(_tk_double); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_boolean. duke@1: */ duke@1: public static final TCKind tk_boolean = new TCKind(_tk_boolean); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_char. duke@1: */ duke@1: public static final TCKind tk_char = new TCKind(_tk_char); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_octet. duke@1: */ duke@1: public static final TCKind tk_octet = new TCKind(_tk_octet); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_any. duke@1: */ duke@1: public static final TCKind tk_any = new TCKind(_tk_any); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_TypeCode. duke@1: */ duke@1: public static final TCKind tk_TypeCode = new TCKind(_tk_TypeCode); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_Principal. duke@1: */ duke@1: public static final TCKind tk_Principal = new TCKind(_tk_Principal); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_objref. duke@1: */ duke@1: public static final TCKind tk_objref = new TCKind(_tk_objref); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_struct. duke@1: */ duke@1: public static final TCKind tk_struct = new TCKind(_tk_struct); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_union. duke@1: */ duke@1: public static final TCKind tk_union = new TCKind(_tk_union); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_enum. duke@1: */ duke@1: public static final TCKind tk_enum = new TCKind(_tk_enum); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_string. duke@1: */ duke@1: public static final TCKind tk_string = new TCKind(_tk_string); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_sequence. duke@1: */ duke@1: public static final TCKind tk_sequence = new TCKind(_tk_sequence); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_array. duke@1: */ duke@1: public static final TCKind tk_array = new TCKind(_tk_array); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_alias. duke@1: */ duke@1: public static final TCKind tk_alias = new TCKind(_tk_alias); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_except. duke@1: */ duke@1: public static final TCKind tk_except = new TCKind(_tk_except); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_longlong. duke@1: */ duke@1: public static final TCKind tk_longlong = new TCKind(_tk_longlong); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_ulonglong. duke@1: */ duke@1: public static final TCKind tk_ulonglong = new TCKind(_tk_ulonglong); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_longdouble. duke@1: */ duke@1: public static final TCKind tk_longdouble = new TCKind(_tk_longdouble); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_wchar. duke@1: */ duke@1: public static final TCKind tk_wchar = new TCKind(_tk_wchar); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_wstring. duke@1: */ duke@1: public static final TCKind tk_wstring = new TCKind(_tk_wstring); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_fixed. duke@1: */ duke@1: public static final TCKind tk_fixed = new TCKind(_tk_fixed); duke@1: duke@1: // orbos 98-01-18: Objects By Value -- begin duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_value. duke@1: */ duke@1: public static final TCKind tk_value = new TCKind(_tk_value); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_value_box. duke@1: */ duke@1: public static final TCKind tk_value_box = new TCKind(_tk_value_box); duke@1: // orbos 98-01-18: Objects By Value -- end duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_native. duke@1: */ duke@1: public static final TCKind tk_native = new TCKind(_tk_native); duke@1: duke@1: /** duke@1: * The TCKind constant whose value field is duke@1: * initialized with TCKind._tk_abstract_interface. duke@1: */ duke@1: public static final TCKind tk_abstract_interface = new TCKind(_tk_abstract_interface); duke@1: duke@1: duke@1: duke@1: duke@1: /** duke@1: * Retrieves the value of this TCKind instance. duke@1: * duke@1: * @return the int that represents the kind of duke@1: * IDL data type for this TCKind instance duke@1: */ duke@1: public int value() { duke@1: return _value; duke@1: } duke@1: duke@1: /** duke@1: * Converts the given int to the corresponding duke@1: * TCKind instance. duke@1: * duke@1: * @param i the int to convert. It must be one of duke@1: * the int constants in the class duke@1: * TCKind. duke@1: * @return the TCKind instance whose value duke@1: * field matches the given int duke@1: * @exception BAD_PARAM if the given int does not duke@1: * match the _value field of duke@1: * any TCKind instance duke@1: */ duke@1: public static TCKind from_int(int i) { duke@1: switch (i) { duke@1: case _tk_null: duke@1: return tk_null; duke@1: case _tk_void: duke@1: return tk_void; duke@1: case _tk_short: duke@1: return tk_short; duke@1: case _tk_long: duke@1: return tk_long; duke@1: case _tk_ushort: duke@1: return tk_ushort; duke@1: case _tk_ulong: duke@1: return tk_ulong; duke@1: case _tk_float: duke@1: return tk_float; duke@1: case _tk_double: duke@1: return tk_double; duke@1: case _tk_boolean: duke@1: return tk_boolean; duke@1: case _tk_char: duke@1: return tk_char; duke@1: case _tk_octet: duke@1: return tk_octet; duke@1: case _tk_any: duke@1: return tk_any; duke@1: case _tk_TypeCode: duke@1: return tk_TypeCode; duke@1: case _tk_Principal: duke@1: return tk_Principal; duke@1: case _tk_objref: duke@1: return tk_objref; duke@1: case _tk_struct: duke@1: return tk_struct; duke@1: case _tk_union: duke@1: return tk_union; duke@1: case _tk_enum: duke@1: return tk_enum; duke@1: case _tk_string: duke@1: return tk_string; duke@1: case _tk_sequence: duke@1: return tk_sequence; duke@1: case _tk_array: duke@1: return tk_array; duke@1: case _tk_alias: duke@1: return tk_alias; duke@1: case _tk_except: duke@1: return tk_except; duke@1: case _tk_longlong: duke@1: return tk_longlong; duke@1: case _tk_ulonglong: duke@1: return tk_ulonglong; duke@1: case _tk_longdouble: duke@1: return tk_longdouble; duke@1: case _tk_wchar: duke@1: return tk_wchar; duke@1: case _tk_wstring: duke@1: return tk_wstring; duke@1: case _tk_fixed: duke@1: return tk_fixed; duke@1: case _tk_value: // orbos 98-01-18: Objects By Value duke@1: return tk_value; duke@1: case _tk_value_box: // orbos 98-01-18: Objects By Value duke@1: return tk_value_box; duke@1: case _tk_native: duke@1: return tk_native; duke@1: case _tk_abstract_interface: duke@1: return tk_abstract_interface; duke@1: default: duke@1: throw new org.omg.CORBA.BAD_PARAM(); duke@1: } duke@1: } duke@1: duke@1: duke@1: /** duke@1: * Creates a new TCKind instance initialized with the given duke@1: * int. duke@1: * @deprecated Do not use this constructor as this method should be private duke@1: * according to the OMG specification. Use {@link #from_int(int)} instead. duke@1: * duke@1: * @param _value the int to convert. It must be one of duke@1: * the int constants in the class duke@1: * TCKind. duke@1: */ duke@1: @Deprecated duke@1: protected TCKind(int _value){ duke@1: this._value = _value; duke@1: } duke@1: private int _value; duke@1: }