/* * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.omg.CORBA; /** * A modifiable list containing NamedValue objects. *

* The class NVList is used as follows: *

*

* Each NamedValue object consists of the following: *

*

* An NVList object * may be created using one of the following * ORB methods: *

    *
  1. org.omg.CORBA.ORB.create_list *
     *    org.omg.CORBA.NVList nv = orb.create_list(3);
     * 
    * The variable nv represents a newly-created * NVList object. The argument is a memory-management * hint to the orb and does not imply the actual length of the list. * If, for example, you want to use an NVList object * in a request, and the method being invoked takes three parameters, * you might optimize by supplying 3 to the method * create_list. Note that the new NVList * will not necessarily have a length of 3; it * could have a length of 2 or 4, for instance. * Note also that you can add any number of * NamedValue objects to this list regardless of * its original length. *
  2. org.omg.CORBA.ORB.create_operation_list *
     *    org.omg.CORBA.NVList nv = orb.create_operation_list(myOperationDef);
     * 
    * The variable nv represents a newly-created * NVList object that contains descriptions of the * arguments to the method described in the given * OperationDef object. *
*

* The methods in the class NVList all deal with * the NamedValue objects in the list. * There are three methods for adding a NamedValue object, * a method for getting the count of NamedValue objects in * the list, a method for retrieving a NamedValue object * at a given index, and a method for removing a NamedValue object * at a given index. * * @see org.omg.CORBA.Request * @see org.omg.CORBA.ServerRequest * @see org.omg.CORBA.NamedValue * @see org.omg.CORBA.Context * * @since JDK1.2 */ public abstract class NVList { /** * Returns the number of NamedValue objects that have * been added to this NVList object. * * @return an int indicating the number of * NamedValue objects in this NVList. */ public abstract int count(); /** * Creates a new NamedValue object initialized with the given flag * and adds it to the end of this NVList object. * The flag can be any one of the argument passing modes: * ARG_IN.value, ARG_OUT.value, or * ARG_INOUT.value. * * @param flags one of the argument mode flags * @return the newly-created NamedValue object */ public abstract NamedValue add(int flags); /** * Creates a new NamedValue object initialized with the * given name and flag, * and adds it to the end of this NVList object. * The flag can be any one of the argument passing modes: * ARG_IN.value, ARG_OUT.value, or * ARG_INOUT.value. * * @param item_name the name for the new NamedValue object * @param flags one of the argument mode flags * @return the newly-created NamedValue object */ public abstract NamedValue add_item(String item_name, int flags); /** * Creates a new NamedValue object initialized with the * given name, value, and flag, * and adds it to the end of this NVList object. * * @param item_name the name for the new NamedValue object * @param val an Any object containing the value * for the new NamedValue object * @param flags one of the following argument passing modes: * ARG_IN.value, ARG_OUT.value, or * ARG_INOUT.value * @return the newly created NamedValue object */ public abstract NamedValue add_value(String item_name, Any val, int flags); /** * Retrieves the NamedValue object at the given index. * * @param index the index of the desired NamedValue object, * which must be between zero and the length of the list * minus one, inclusive. The first item is at index zero. * @return the NamedValue object at the given index * @exception org.omg.CORBA.Bounds if the index is greater than * or equal to number of NamedValue objects */ public abstract NamedValue item(int index) throws org.omg.CORBA.Bounds; /** * Removes the NamedValue object at the given index. * Note that the indices of all NamedValue objects following * the one removed are shifted down by one. * * @param index the index of the NamedValue object to be * removed, which must be between zero and the length * of the list minus one, inclusive. * The first item is at index zero. * @exception org.omg.CORBA.Bounds if the index is greater than * or equal to number of NamedValue objects in * the list */ public abstract void remove(int index) throws org.omg.CORBA.Bounds; }