- java.lang.Object
-
- org.omg.CORBA.NVList
-
public abstract class NVList extends Object
A modifiable list containingNamedValue
objects.The class
NVList
is used as follows:- to describe arguments for a
Request
object in the Dynamic Invocation Interface and the Dynamic Skeleton Interface - to describe context values in a
Context
object
Each
NamedValue
object consists of the following:- a name, which is a
String
object - a value, as an
Any
object - an argument mode flag
An
NVList
object may be created using one of the followingORB
methods:org.omg.CORBA.ORB.create_list
org.omg.CORBA.NVList nv = orb.create_list(3);
The variablenv
represents a newly-createdNVList
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 anNVList
object in a request, and the method being invoked takes three parameters, you might optimize by supplying 3 to the methodcreate_list
. Note that the newNVList
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 ofNamedValue
objects to this list regardless of its original length.org.omg.CORBA.ORB.create_operation_list
org.omg.CORBA.NVList nv = orb.create_operation_list(myOperationDef);
The variablenv
represents a newly-createdNVList
object that contains descriptions of the arguments to the method described in the givenOperationDef
object.
The methods in the class
NVList
all deal with theNamedValue
objects in the list. There are three methods for adding aNamedValue
object, a method for getting the count ofNamedValue
objects in the list, a method for retrieving aNamedValue
object at a given index, and a method for removing aNamedValue
object at a given index.- Since:
- JDK1.2
- See Also:
Request
,ServerRequest
,NamedValue
,Context
- to describe arguments for a
-
-
Constructor Summary
Constructors Constructor and Description NVList()
-
Method Summary
Methods Modifier and Type Method and Description abstract NamedValue
add_item(String item_name, int flags)
Creates a newNamedValue
object initialized with the given name and flag, and adds it to the end of thisNVList
object.abstract NamedValue
add_value(String item_name, Any val, int flags)
Creates a newNamedValue
object initialized with the given name, value, and flag, and adds it to the end of thisNVList
object.abstract NamedValue
add(int flags)
Creates a newNamedValue
object initialized with the given flag and adds it to the end of thisNVList
object.abstract int
count()
Returns the number ofNamedValue
objects that have been added to thisNVList
object.abstract NamedValue
item(int index)
Retrieves theNamedValue
object at the given index.abstract void
remove(int index)
Removes theNamedValue
object at the given index.
-
-
-
Method Detail
-
count
public abstract int count()
Returns the number ofNamedValue
objects that have been added to thisNVList
object.- Returns:
- an
int
indicating the number ofNamedValue
objects in thisNVList
.
-
add
public abstract NamedValue add(int flags)
Creates a newNamedValue
object initialized with the given flag and adds it to the end of thisNVList
object. The flag can be any one of the argument passing modes:ARG_IN.value
,ARG_OUT.value
, orARG_INOUT.value
.- Parameters:
flags
- one of the argument mode flags- Returns:
- the newly-created
NamedValue
object
-
add_item
public abstract NamedValue add_item(String item_name, int flags)
Creates a newNamedValue
object initialized with the given name and flag, and adds it to the end of thisNVList
object. The flag can be any one of the argument passing modes:ARG_IN.value
,ARG_OUT.value
, orARG_INOUT.value
.- Parameters:
item_name
- the name for the newNamedValue
objectflags
- one of the argument mode flags- Returns:
- the newly-created
NamedValue
object
-
add_value
public abstract NamedValue add_value(String item_name, Any val, int flags)
Creates a newNamedValue
object initialized with the given name, value, and flag, and adds it to the end of thisNVList
object.- Parameters:
item_name
- the name for the newNamedValue
objectval
- anAny
object containing the value for the newNamedValue
objectflags
- one of the following argument passing modes:ARG_IN.value
,ARG_OUT.value
, orARG_INOUT.value
- Returns:
- the newly created
NamedValue
object
-
item
public abstract NamedValue item(int index) throws Bounds
Retrieves theNamedValue
object at the given index.- Parameters:
index
- the index of the desiredNamedValue
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
- if the index is greater than or equal to number ofNamedValue
objects
-
remove
public abstract void remove(int index) throws Bounds
Removes theNamedValue
object at the given index. Note that the indices of allNamedValue
objects following the one removed are shifted down by one.- Parameters:
index
- the index of theNamedValue
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
- if the index is greater than or equal to number ofNamedValue
objects in the list
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-org/omg/corba/nvlist.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.