0N/A/*
239N/A * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
157N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
157N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
157N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157N/A * or visit www.oracle.com if you need additional information or have any
157N/A * questions.
0N/A */
0N/A
0N/Apackage org.omg.CORBA;
0N/A
0N/A/**
0N/A * The mapping of a CORBA <code>enum</code> tagging
0N/A * <code>SET_OVERRIDE</code> and <code>ADD_OVERRIDE</code>, which
0N/A * indicate whether policies should replace the
0N/A * existing policies of an <code>Object</code> or be added to them.
0N/A * <P>
134N/A * The method {@link org.omg.CORBA.Object#_set_policy_override} takes
0N/A * either <code>SetOverrideType.SET_OVERRIDE</code> or
0N/A * <code>SetOverrideType.ADD_OVERRIDE</code> as its second argument.
0N/A * The method <code>_set_policy_override</code>
0N/A * creates a new <code>Object</code> initialized with the
0N/A * <code>Policy</code> objects supplied as the first argument. If the
0N/A * second argument is <code>ADD_OVERRIDE</code>, the new policies
0N/A * are added to those of the <code>Object</code> instance that is
0N/A * calling the <code>_set_policy_override</code> method. If
0N/A * <code>SET_OVERRIDE</code> is given instead, the existing policies
0N/A * are replaced with the given ones.
0N/A *
0N/A * @author OMG
0N/A * @since JDK1.2
0N/A */
0N/A
0N/Apublic class SetOverrideType implements org.omg.CORBA.portable.IDLEntity {
0N/A
0N/A /**
0N/A * The <code>int</code> constant for the enum value SET_OVERRIDE.
0N/A */
0N/A public static final int _SET_OVERRIDE = 0;
0N/A
0N/A /**
0N/A * The <code>int</code> constant for the enum value ADD_OVERRIDE.
0N/A */
0N/A public static final int _ADD_OVERRIDE = 1;
0N/A
0N/A /**
0N/A * The <code>SetOverrideType</code> constant for the enum value SET_OVERRIDE.
0N/A */
0N/A public static final SetOverrideType SET_OVERRIDE = new SetOverrideType(_SET_OVERRIDE);
0N/A
0N/A /**
0N/A * The <code>SetOverrideType</code> constant for the enum value ADD_OVERRIDE.
0N/A */
0N/A public static final SetOverrideType ADD_OVERRIDE = new SetOverrideType(_ADD_OVERRIDE);
0N/A
0N/A /**
0N/A * Retrieves the value of this <code>SetOverrideType</code> instance.
0N/A *
0N/A * @return the <code>int</code> for this <code>SetOverrideType</code> instance.
0N/A */
0N/A public int value() {
0N/A return _value;
0N/A }
0N/A
0N/A /**
0N/A * Converts the given <code>int</code> to the corresponding
0N/A * <code>SetOverrideType</code> instance.
0N/A *
0N/A * @param i the <code>int</code> to convert; must be either
0N/A * <code>SetOverrideType._SET_OVERRIDE</code> or
0N/A * <code>SetOverrideType._ADD_OVERRIDE</code>
0N/A * @return the <code>SetOverrideType</code> instance whose value
0N/A * matches the given <code>int</code>
0N/A * @exception BAD_PARAM if the given <code>int</code> does not
0N/A * match the value of
0N/A * any <code>SetOverrideType</code> instance
0N/A */
0N/A public static SetOverrideType from_int(int i)
0N/A {
0N/A switch (i) {
0N/A case _SET_OVERRIDE:
0N/A return SET_OVERRIDE;
0N/A case _ADD_OVERRIDE:
0N/A return ADD_OVERRIDE;
0N/A default:
0N/A throw new org.omg.CORBA.BAD_PARAM();
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Constructs a <code>SetOverrideType</code> instance from an
0N/A * <code>int</code>.
0N/A * @param _value must be either <code>SET_OVERRIDE</code> or
0N/A * <code>ADD_OVERRIDE</code>
0N/A */
0N/A protected SetOverrideType(int _value){
0N/A this._value = _value;
0N/A }
0N/A
0N/A /**
0N/A * The field containing the value for this <code>SetOverrideType</code>
0N/A * object.
0N/A *
0N/A */
0N/A private int _value;
0N/A}