- java.lang.Object
-
- org.omg.CORBA.ContextList
-
public abstract class ContextList extends Object
An object containing a modifiable list ofStringobjects that represent property names. This class is used inRequestoperations to describe the contexts that need to be resolved and sent with the invocation. (A context is resolved by giving a property name and getting back the value associated with it.) This is done by calling theContextmethodget_valuesand supplying a string from aContextListobject as the third parameter. The methodget_valuesreturns anNVListobject containing theNamedValueobjects that hold the value(s) identified by the given string.A
ContextListobject is created by the ORB, as illustrated here:ORB orb = ORB.init(args, null); org.omg.CORBA.ContextList ctxList = orb.create_context_list();
The variablectxListrepresents an emptyContextListobject. Strings are added to the list with the methodadd, accessed with the methoditem, and removed with the methodremove.- Since:
- JDK1.2
- See Also:
Context
-
-
Constructor Summary
Constructors Constructor Description ContextList()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidadd(String ctx)Adds aStringobject to thisContextListobject.abstract intcount()Returns the number ofStringobjects in thisContextListobject.abstract Stringitem(int index)Returns theStringobject at the given index.abstract voidremove(int index)Removes theStringobject at the given index.
-
-
-
Method Detail
-
count
public abstract int count()
Returns the number ofStringobjects in thisContextListobject.- Returns:
- an
intrepresenting the number ofStrings in thisContextListobject
-
add
public abstract void add(String ctx)
Adds aStringobject to thisContextListobject.- Parameters:
ctx- theStringobject to be added
-
item
public abstract String item(int index) throws Bounds
Returns theStringobject at the given index.- Parameters:
index- the index of the string desired, with 0 being the index of the first string- Returns:
- the string at the given index
- Throws:
Bounds- if the index is greater than or equal to the number of strings in thisContextListobject
-
remove
public abstract void remove(int index) throws BoundsRemoves theStringobject at the given index. Note that the indices of all strings following the one removed are shifted down by one.- Parameters:
index- the index of theStringobject to be removed, with 0 designating the first string- Throws:
Bounds- if the index is greater than or equal to the number ofStringobjects in thisContextListobject
-
-