corba/src/share/classes/org/omg/CORBA/SetOverrideType.java
author andrew
Sat, 16 Jan 2010 01:04:04 +0000
changeset 4623 e3aaa29eff65
parent 4 02bb8761fcce
child 5555 b2b5ed3f0d0d
permissions -rw-r--r--
6917485: Corba doc warnings Summary: Fix warnings generated by javadoc Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
02bb8761fcce Initial load
duke
parents:
diff changeset
     2
 * Copyright 1998-2000 Sun Microsystems, Inc.  All Rights Reserved.
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
 * have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
package org.omg.CORBA;
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
 * The mapping of a CORBA <code>enum</code> tagging
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
 * <code>SET_OVERRIDE</code> and <code>ADD_OVERRIDE</code>, which
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
 * indicate whether policies should replace the
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
 * existing policies of an <code>Object</code> or be added to them.
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
 * <P>
4623
e3aaa29eff65 6917485: Corba doc warnings
andrew
parents: 4
diff changeset
    34
 * The method {@link org.omg.CORBA.Object#_set_policy_override} takes
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
 * either <code>SetOverrideType.SET_OVERRIDE</code> or
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
 * <code>SetOverrideType.ADD_OVERRIDE</code> as its second argument.
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
 * The method <code>_set_policy_override</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
 * creates a new <code>Object</code> initialized with the
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
 * <code>Policy</code> objects supplied as the first argument.  If the
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
 * second argument is <code>ADD_OVERRIDE</code>, the new policies
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
 * are added to those of the <code>Object</code> instance that is
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
 * calling the <code>_set_policy_override</code> method.  If
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
 * <code>SET_OVERRIDE</code> is given instead, the existing policies
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * are replaced with the given ones.
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
 * @author OMG
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
 * @since   JDK1.2
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
public class SetOverrideType implements org.omg.CORBA.portable.IDLEntity {
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
     * The <code>int</code> constant for the enum value SET_OVERRIDE.
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
    public static final int _SET_OVERRIDE = 0;
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
     * The <code>int</code> constant for the enum value ADD_OVERRIDE.
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
    public static final int _ADD_OVERRIDE = 1;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
     * The <code>SetOverrideType</code> constant for the enum value SET_OVERRIDE.
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
    public static final SetOverrideType SET_OVERRIDE = new SetOverrideType(_SET_OVERRIDE);
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
     * The <code>SetOverrideType</code> constant for the enum value ADD_OVERRIDE.
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
    public static final SetOverrideType ADD_OVERRIDE = new SetOverrideType(_ADD_OVERRIDE);
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
     * Retrieves the value of this <code>SetOverrideType</code> instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
     * @return  the <code>int</code> for this <code>SetOverrideType</code> instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
    public int value() {
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
        return _value;
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
     * Converts the given <code>int</code> to the corresponding
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
     * <code>SetOverrideType</code> instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
     * @param  i the <code>int</code> to convert; must be either
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
     *         <code>SetOverrideType._SET_OVERRIDE</code> or
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
     *         <code>SetOverrideType._ADD_OVERRIDE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
     * @return  the <code>SetOverrideType</code> instance whose value
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
     *       matches the given <code>int</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
     * @exception  BAD_PARAM  if the given <code>int</code> does not
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
     *       match the value of
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
     *       any <code>SetOverrideType</code> instance
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
    public static SetOverrideType from_int(int i)
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
        switch (i) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
        case _SET_OVERRIDE:
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
            return SET_OVERRIDE;
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
        case _ADD_OVERRIDE:
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
            return ADD_OVERRIDE;
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
        default:
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
            throw new org.omg.CORBA.BAD_PARAM();
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
     * Constructs a <code>SetOverrideType</code> instance from an
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
     * <code>int</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
     * @param _value must be either <code>SET_OVERRIDE</code> or
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
     *        <code>ADD_OVERRIDE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    protected SetOverrideType(int _value){
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
        this._value = _value;
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
     * The field containing the value for this <code>SetOverrideType</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
     * object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
    private int _value;
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
}