corba/src/java.corba/share/classes/org/omg/CORBA/CompletionStatus.java
author avstepan
Wed, 08 Apr 2015 16:01:26 +0400
changeset 29827 aac4782e69ac
parent 25862 a5e25d68f971
permissions -rw-r--r--
8039440: Tidy warnings cleanup for org/omg Summary: some HTML markup fixes for CORBA Reviewed-by: yan, rriggs, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
29827
aac4782e69ac 8039440: Tidy warnings cleanup for org/omg
avstepan
parents: 25862
diff changeset
     2
 * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
4
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
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
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
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
package org.omg.CORBA;
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
 * An object that indicates whether a method had completed running
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
 * when a <code>SystemException</code> was thrown.
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
 * The class <code>CompletionStatus</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
 * contains three <code>CompletionStatus</code> instances, which are constants
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
 * representing each
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
 * possible completion status: <code>COMPLETED_MAYBE</code>,
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
 * <code>COMPLETED_NO</code>, and <code>COMPLETED_YES</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
 * It also contains
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
 * three <code>int</code> members, each a constant corresponding to one of
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
 * the <code>CompletionStatus</code> instances.  These <code>int</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
 * members make it possible to use a <code>switch</code> statement.
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
 * The class also contains two methods:
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
 * <UL>
29827
aac4782e69ac 8039440: Tidy warnings cleanup for org/omg
avstepan
parents: 25862
diff changeset
    43
 * <LI><code>public int <b>value</b>()</code> -- which accesses the
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * <code>value</code> field of a <code>CompletionStatus</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 * <LI><code>public static CompletionStatus
29827
aac4782e69ac 8039440: Tidy warnings cleanup for org/omg
avstepan
parents: 25862
diff changeset
    46
 * <b>from_int</b>(int i)</code> --
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
 * for creating an instance from one of the <code>int</code> members
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
 * </UL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
 * @see     org.omg.CORBA.SystemException
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
 * @since   JDK1.2
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
public final class CompletionStatus implements org.omg.CORBA.portable.IDLEntity
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
{
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
 * The constant indicating that a method completed running
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
 * before a <code>SystemException</code> was thrown.
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
    public static final int _COMPLETED_YES = 0,
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
 * The constant indicating that a method had not completed running
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
 * when a <code>SystemException</code> was thrown.
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
        _COMPLETED_NO = 1,
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 constant indicating that it is unknown whether a method had
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
 * completed running when a <code>SystemException</code> was thrown.
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
        _COMPLETED_MAYBE = 2;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
 * An instance of <code>CompletionStatus</code> initialized with
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
 * the constant <code>_COMPLETED_YES</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
    public static final CompletionStatus COMPLETED_YES   = new CompletionStatus(_COMPLETED_YES);
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
 * An instance of <code>CompletionStatus</code> initialized with
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
 * the constant <code>_COMPLETED_NO</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
    public static final CompletionStatus COMPLETED_NO    = new CompletionStatus(_COMPLETED_NO);
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
 * An instance of <code>CompletionStatus</code> initialized with
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
 * the constant <code>_COMPLETED_MAYBE</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
    public static final CompletionStatus COMPLETED_MAYBE = new CompletionStatus(_COMPLETED_MAYBE);
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
 * Retrieves the value of this <code>CompletionStatus</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
 * @return  one of the possible <code>CompletionStatus</code> values:
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
 *          <code>_COMPLETED_YES</code>, <code>_COMPLETED_NO</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
 *          <code>_COMPLETED_MAYBE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    public int value() { return _value; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
 * Creates a <code>CompletionStatus</code> object from the given <code>int</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
 * @param i  one of <code>_COMPLETED_YES</code>, <code>_COMPLETED_NO</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
 *          <code>_COMPLETED_MAYBE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
 * @return  one of the possible <code>CompletionStatus</code> objects
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
 *          with values:
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
 *          <code>_COMPLETED_YES</code>, <code>_COMPLETED_NO</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
 *          <code>_COMPLETED_MAYBE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
 * @exception org.omg.CORBA.BAD_PARAM  if the argument given is not one of the
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
 *            <code>int</code> constants defined in <code>CompletionStatus</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    public static CompletionStatus from_int(int i)  {
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
        switch (i) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
        case _COMPLETED_YES:
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
            return COMPLETED_YES;
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
        case _COMPLETED_NO:
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
            return COMPLETED_NO;
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
        case _COMPLETED_MAYBE:
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
            return COMPLETED_MAYBE;
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
        default:
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
            throw new org.omg.CORBA.BAD_PARAM();
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
 * Creates a <code>CompletionStatus</code> object from the given <code>int</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
 * @param _value  one of <code>_COMPLETED_YES</code>, <code>_COMPLETED_NO</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
 *          <code>_COMPLETED_MAYBE</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
    private CompletionStatus(int _value) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
        this._value = _value;
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
    private int _value;
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
}