org.omg.CORBA
Class ContextList

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

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

An object containing a modifiable list of String objects that represent property names. This class is used in Request operations 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 the Context method get_values and supplying a string from a ContextList object as the third parameter. The method get_values returns an NVList object containing the NamedValue objects that hold the value(s) identified by the given string.

A ContextList object is created by the ORB, as illustrated here:

   ORB orb = ORB.init(args, null);
   org.omg.CORBA.ContextList ctxList = orb.create_context_list();
 
The variable ctxList represents an empty ContextList object. Strings are added to the list with the method add, accessed with the method item, and removed with the method remove.

Since:
JDK1.2
See Also:
Context sample code for org.omg.CORBA.Context definition code for org.omg.CORBA.Context

Constructor Summary
ContextList sample code for org.omg.CORBA.ContextList.ContextList() definition code for org.omg.CORBA.ContextList.ContextList() ()
           
 
Method Summary
abstract  void add sample code for org.omg.CORBA.ContextList.add(java.lang.String) definition code for org.omg.CORBA.ContextList.add(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  ctx)
          Adds a String object to this ContextList object.
abstract  int count sample code for org.omg.CORBA.ContextList.count() definition code for org.omg.CORBA.ContextList.count() ()
          Returns the number of String objects in this ContextList object.
abstract  String sample code for java.lang.String definition code for java.lang.String item sample code for org.omg.CORBA.ContextList.item(int) definition code for org.omg.CORBA.ContextList.item(int) (int index)
          Returns the String object at the given index.
abstract  void remove sample code for org.omg.CORBA.ContextList.remove(int) definition code for org.omg.CORBA.ContextList.remove(int) (int index)
          Removes the String 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

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

public ContextList()
Method Detail

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

public abstract int count()
Returns the number of String objects in this ContextList object.

Returns:
an int representing the number of Strings in this ContextList object

add sample code for org.omg.CORBA.ContextList.add(java.lang.String) definition code for org.omg.CORBA.ContextList.add(java.lang.String)

public abstract void add(String sample code for java.lang.String definition code for java.lang.String  ctx)
Adds a String object to this ContextList object.

Parameters:
ctx - the String object to be added

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

public abstract String sample code for java.lang.String definition code for java.lang.String  item(int index)
                     throws Bounds sample code for org.omg.CORBA.Bounds definition code for org.omg.CORBA.Bounds 
Returns the String object 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 sample code for org.omg.CORBA.Bounds definition code for org.omg.CORBA.Bounds - if the index is greater than or equal to the number of strings in this ContextList object

remove sample code for org.omg.CORBA.ContextList.remove(int) definition code for org.omg.CORBA.ContextList.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 String object 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 the String object to be removed, with 0 designating the first string
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 the number of String objects in this ContextList object