duke@1: /* ohair@158: * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: duke@1: package org.omg.CORBA; duke@1: duke@1: /** duke@1: * An object containing a modifiable list of String objects duke@1: * that represent property names. duke@1: * This class is used in Request operations to duke@1: * describe the contexts that need to be resolved and sent with the duke@1: * invocation. (A context is resolved by giving a property name duke@1: * and getting back the value associated with it.) This is done duke@1: * by calling the Context method duke@1: * get_values and supplying a string from a duke@1: * ContextList object as the third parameter. duke@1: * The method get_values returns an NVList duke@1: * object containing the NamedValue objects that hold duke@1: * the value(s) identified by the given string. duke@1: *

duke@1: * A ContextList object is created by the ORB, as duke@1: * illustrated here: duke@1: *

duke@1:  *   ORB orb = ORB.init(args, null);
duke@1:  *   org.omg.CORBA.ContextList ctxList = orb.create_context_list();
duke@1:  * 
duke@1: * The variable ctxList represents an empty duke@1: * ContextList object. Strings are added to duke@1: * the list with the method add, accessed duke@1: * with the method item, and removed with the duke@1: * method remove. duke@1: * duke@1: * @see Context duke@1: * @since JDK1.2 duke@1: */ duke@1: duke@1: public abstract class ContextList { duke@1: duke@1: /** duke@1: * Returns the number of String objects in this duke@1: * ContextList object. duke@1: * duke@1: * @return an int representing the number of duke@1: * Strings in this ContextList object duke@1: */ duke@1: duke@1: public abstract int count(); duke@1: duke@1: /** duke@1: * Adds a String object to this ContextList duke@1: * object. duke@1: * duke@1: * @param ctx the String object to be added duke@1: */ duke@1: duke@1: public abstract void add(String ctx); duke@1: duke@1: /** duke@1: * Returns the String object at the given index. duke@1: * duke@1: * @param index the index of the string desired, with 0 being the duke@1: index of the first string duke@1: * @return the string at the given index duke@1: * @exception org.omg.CORBA.Bounds if the index is greater than duke@1: * or equal to the number of strings in this duke@1: * ContextList object duke@1: */ duke@1: duke@1: public abstract String item(int index) throws org.omg.CORBA.Bounds; duke@1: duke@1: /** duke@1: * Removes the String object at the given index. Note that duke@1: * the indices of all strings following the one removed are duke@1: * shifted down by one. duke@1: * duke@1: * @param index the index of the String object to be removed, duke@1: * with 0 designating the first string duke@1: * @exception org.omg.CORBA.Bounds if the index is greater than duke@1: * or equal to the number of String objects in duke@1: * this ContextList object duke@1: */ duke@1: duke@1: public abstract void remove(int index) throws org.omg.CORBA.Bounds; duke@1: duke@1: }