org.omg.CORBA
Class NVList

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by org.omg.CORBA.NVList

public abstract class NVList
extends Object sample code for java.lang.Object definition code for java.lang.Object

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.

Since:
JDK1.2
See Also:
Request sample code for org.omg.CORBA.Request definition code for org.omg.CORBA.Request , ServerRequest sample code for org.omg.CORBA.ServerRequest definition code for org.omg.CORBA.ServerRequest , NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue , Context sample code for org.omg.CORBA.Context definition code for org.omg.CORBA.Context

Constructor Summary
NVList sample code for org.omg.CORBA.NVList.NVList() definition code for org.omg.CORBA.NVList.NVList() ()
           
 
Method Summary
abstract  NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue add_item sample code for org.omg.CORBA.NVList.add_item(java.lang.String, int) definition code for org.omg.CORBA.NVList.add_item(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  item_name, int flags)
          Creates a new NamedValue object initialized with the given name and flag, and adds it to the end of this NVList object.
abstract  NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue add_value sample code for org.omg.CORBA.NVList.add_value(java.lang.String, org.omg.CORBA.Any, int) definition code for org.omg.CORBA.NVList.add_value(java.lang.String, org.omg.CORBA.Any, int) (String sample code for java.lang.String definition code for java.lang.String  item_name, Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  val, 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.
abstract  NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue add sample code for org.omg.CORBA.NVList.add(int) definition code for org.omg.CORBA.NVList.add(int) (int flags)
          Creates a new NamedValue object initialized with the given flag and adds it to the end of this NVList object.
abstract  int count sample code for org.omg.CORBA.NVList.count() definition code for org.omg.CORBA.NVList.count() ()
          Returns the number of NamedValue objects that have been added to this NVList object.
abstract  NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue item sample code for org.omg.CORBA.NVList.item(int) definition code for org.omg.CORBA.NVList.item(int) (int index)
          Retrieves the NamedValue object at the given index.
abstract  void remove sample code for org.omg.CORBA.NVList.remove(int) definition code for org.omg.CORBA.NVList.remove(int) (int index)
          Removes the NamedValue object at the given index.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

NVList sample code for org.omg.CORBA.NVList() definition code for org.omg.CORBA.NVList()

public NVList()
Method Detail

count sample code for org.omg.CORBA.NVList.count() definition code for org.omg.CORBA.NVList.count()

public abstract int count()
Returns the number of NamedValue objects that have been added to this NVList object.

Returns:
an int indicating the number of NamedValue objects in this NVList.

add sample code for org.omg.CORBA.NVList.add(int) definition code for org.omg.CORBA.NVList.add(int)

public abstract NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue  add(int flags)
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.

Parameters:
flags - one of the argument mode flags
Returns:
the newly-created NamedValue object

add_item sample code for org.omg.CORBA.NVList.add_item(java.lang.String, int) definition code for org.omg.CORBA.NVList.add_item(java.lang.String, int)

public abstract NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue  add_item(String sample code for java.lang.String definition code for java.lang.String  item_name,
                                    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.

Parameters:
item_name - the name for the new NamedValue object
flags - one of the argument mode flags
Returns:
the newly-created NamedValue object

add_value sample code for org.omg.CORBA.NVList.add_value(java.lang.String, org.omg.CORBA.Any, int) definition code for org.omg.CORBA.NVList.add_value(java.lang.String, org.omg.CORBA.Any, int)

public abstract NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue  add_value(String sample code for java.lang.String definition code for java.lang.String  item_name,
                                     Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  val,
                                     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.

Parameters:
item_name - the name for the new NamedValue object
val - an Any object containing the value for the new NamedValue object
flags - one of the following argument passing modes: ARG_IN.value, ARG_OUT.value, or ARG_INOUT.value
Returns:
the newly created NamedValue object

item sample code for org.omg.CORBA.NVList.item(int) definition code for org.omg.CORBA.NVList.item(int)

public abstract NamedValue sample code for org.omg.CORBA.NamedValue definition code for org.omg.CORBA.NamedValue  item(int index)
                         throws Bounds sample code for org.omg.CORBA.Bounds definition code for org.omg.CORBA.Bounds 
Retrieves the NamedValue object at the given index.

Parameters:
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.
Returns:
the NamedValue object at the given index
Throws:
Bounds sample code for org.omg.CORBA.Bounds definition code for org.omg.CORBA.Bounds - if the index is greater than or equal to number of NamedValue objects

remove sample code for org.omg.CORBA.NVList.remove(int) definition code for org.omg.CORBA.NVList.remove(int)

public abstract void remove(int index)
                     throws Bounds sample code for org.omg.CORBA.Bounds definition code for 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.

Parameters:
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.
Throws:
Bounds sample code for org.omg.CORBA.Bounds definition code for org.omg.CORBA.Bounds - if the index is greater than or equal to number of NamedValue objects in the list