corba/src/java.corba/share/classes/org/omg/CORBA/NVList.java
author chegar
Mon, 18 Aug 2014 10:07:13 +0100
changeset 26048 c6cdd019b5cb
parent 25862 a5e25d68f971
child 29827 aac4782e69ac
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     2
 * Copyright (c) 1996, 2000, 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
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
 * A modifiable list containing <code>NamedValue</code> objects.
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
 * The class <code>NVList</code> is used as follows:
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
 * <UL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
 * <LI>to describe arguments for a <code>Request</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
 * in the Dynamic Invocation Interface and
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
 * the Dynamic Skeleton Interface
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
 * <LI>to describe context values in a <code>Context</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
 * </UL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
 * Each <code>NamedValue</code> object consists of the following:
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
 * <UL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
 * <LI>a name, which is a <code>String</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
 * <LI>a value, as an <code>Any</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
 * <LI>an argument mode flag
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * </UL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
 * An <code>NVList</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
 * may be created using one of the following
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
 * <code>ORB</code> methods:
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
 * <OL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
 * <LI><code>org.omg.CORBA.ORB.create_list</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
 * <PRE>
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
 *    org.omg.CORBA.NVList nv = orb.create_list(3);
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
 * </PRE>
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
 * The variable <code>nv</code> represents a newly-created
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
 * <code>NVList</code> object.  The argument is a memory-management
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
 * hint to the orb and does not imply the actual length of the list.
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
 * If, for example, you want to use an <code>NVList</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
 * in a request, and the method being invoked takes three parameters,
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
 * you might optimize by supplying 3 to the method
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
 * <code>create_list</code>.  Note that the new <code>NVList</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
 * will not necessarily have a length of 3; it
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
 * could have a length of 2 or 4, for instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
 * Note also that you can add any number of
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
 * <code>NamedValue</code> objects to this list regardless of
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
 * its original length.
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
 * <LI><code>org.omg.CORBA.ORB.create_operation_list</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
 * <PRE>
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
 *    org.omg.CORBA.NVList nv = orb.create_operation_list(myOperationDef);
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
 * </PRE>
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
 * The variable <code>nv</code> represents a newly-created
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
 * <code>NVList</code> object that contains descriptions of the
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
 * arguments to the method described in the given
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
 * <code>OperationDef</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
 * </OL>
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
 * <P>
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
 * The methods in the class <code>NVList</code> all deal with
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
 * the <code>NamedValue</code> objects in the list.
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
 * There are three methods for adding a <code>NamedValue</code> object,
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
 * a method for getting the count of <code>NamedValue</code> objects in
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
 * the list, a method for retrieving a <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
 * at a given index, and a method for removing a <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
 * at a given index.
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
 * @see org.omg.CORBA.Request
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
 * @see org.omg.CORBA.ServerRequest
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
 * @see org.omg.CORBA.NamedValue
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
 * @see org.omg.CORBA.Context
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
 * @since       JDK1.2
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
public abstract class NVList {
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
     * Returns the number of <code>NamedValue</code> objects that have
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
     * been added to this <code>NVList</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
     * @return                  an <code>int</code> indicating the number of
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
     * <code>NamedValue</code> objects in this <code>NVList</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    public abstract int count();
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
     * Creates a new <code>NamedValue</code> object initialized with the given flag
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
     * and adds it to the end of this <code>NVList</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
     * The flag can be any one of the argument passing modes:
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
     * <code>ARG_IN.value</code>, <code>ARG_OUT.value</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
     * <code>ARG_INOUT.value</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
     * @param flags             one of the argument mode flags
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
     * @return                  the newly-created <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    public abstract NamedValue add(int flags);
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
     * Creates a new <code>NamedValue</code> object initialized with the
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
     * given name and flag,
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
     * and adds it to the end of this <code>NVList</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
     * The flag can be any one of the argument passing modes:
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
     * <code>ARG_IN.value</code>, <code>ARG_OUT.value</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
     * <code>ARG_INOUT.value</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
     * @param item_name the name for the new <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
     * @param flags             one of the argument mode flags
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
     * @return                  the newly-created <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
    public abstract NamedValue add_item(String item_name, int flags);
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
     * Creates a new <code>NamedValue</code> object initialized with the
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
     * given name, value, and flag,
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
     * and adds it to the end of this <code>NVList</code> object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
     * @param item_name the name for the new <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
     * @param val         an <code>Any</code> object containing the  value
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
     *                    for the new <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
     * @param flags       one of the following argument passing modes:
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
     *                    <code>ARG_IN.value</code>, <code>ARG_OUT.value</code>, or
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
     *                    <code>ARG_INOUT.value</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
     * @return            the newly created <code>NamedValue</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
    public abstract NamedValue add_value(String item_name, Any val, int flags);
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
     * Retrieves the <code>NamedValue</code> object at the given index.
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
     * @param index             the index of the desired <code>NamedValue</code> object,
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
     *                    which must be between zero and the length of the list
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
     *                    minus one, inclusive.  The first item is at index zero.
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
     * @return                  the <code>NamedValue</code> object at the given index
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
     * @exception org.omg.CORBA.Bounds  if the index is greater than
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
     *                          or equal to number of <code>NamedValue</code> objects
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
    public abstract NamedValue item(int index) throws org.omg.CORBA.Bounds;
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
     * Removes the <code>NamedValue</code> object at the given index.
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
     * Note that the indices of all <code>NamedValue</code> objects following
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
     * the one removed are shifted down by one.
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
     * @param index             the index of the <code>NamedValue</code> object to be
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
     *                    removed, which must be between zero and the length
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
     *                    of the list minus one, inclusive.
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
     *                    The first item is at index zero.
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
     * @exception org.omg.CORBA.Bounds  if the index is greater than
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
     *                          or equal to number of <code>NamedValue</code> objects in
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
     *                the list
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
    public abstract void remove(int index) throws org.omg.CORBA.Bounds;
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
}