ExceptionList.java revision 0
0N/A * Copyright 1996-1999 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * An object used in <code>Request</code> operations to 0N/A * describe the exceptions that can be thrown by a method. It maintains a 0N/A * modifiable list of <code>TypeCode</code>s of the exceptions. 0N/A * The following code fragment demonstrates creating 0N/A * an <code>ExceptionList</code> object: 0N/A * org.omg.CORBA.ExceptionList excList = orb.create_exception_list(); 0N/A * The variable <code>excList</code> represents an <code>ExceptionList</code> 0N/A * object with no <code>TypeCode</code> objects in it. 0N/A * To add items to the list, you first create a <code>TypeCode</code> object 0N/A * for the exception you want to include, using the <code>ORB</code> method 0N/A * <code>create_exception_tc</code>. Then you use the <code>ExceptionList</code> 0N/A * method <code>add</code> to add it to the list. 0N/A * The class <code>ExceptionList</code> has a method for getting 0N/A * the number of <code>TypeCode</code> objects in the list, and after 0N/A * items have been added, it is possible to call methods for accessing 0N/A * or deleting an item at a designated index. 0N/A * Retrieves the number of <code>TypeCode</code> objects in this 0N/A * <code>ExceptionList</code> object. 0N/A * @return the number of <code>TypeCode</code> objects in this 0N/A * <code>ExceptionList</code> object 0N/A * Adds a <code>TypeCode</code> object describing an exception 0N/A * to this <code>ExceptionList</code> object. 0N/A * @param exc the <code>TypeCode</code> object to be added 0N/A * Returns the <code>TypeCode</code> object at the given index. The first 0N/A * item is at index 0. 0N/A * @param index the index of the <code>TypeCode</code> object desired. 0N/A * This must be an <code>int</code> between 0 and the 0N/A * number of <code>TypeCode</code> objects 0N/A * minus one, inclusive. 0N/A * @return the <code>TypeCode</code> object at the given index 0N/A * @exception org.omg.CORBA.Bounds if the index given is greater than 0N/A * or equal to the number of <code>TypeCode</code> objects 0N/A * in this <code>ExceptionList</code> object 0N/A * Removes the <code>TypeCode</code> object at the given index. 0N/A * Note that the indices of all the <code>TypeCoded</code> objects 0N/A * following the one deleted are shifted down by one. 0N/A * @param index the index of the <code>TypeCode</code> object to be 0N/A * This must be an <code>int</code> between 0 and the 0N/A * number of <code>TypeCode</code> objects 0N/A * minus one, inclusive. 0N/A * @exception org.omg.CORBA.Bounds if the index is greater than 0N/A * or equal to the number of <code>TypeCode</code> objects 0N/A * in this <code>ExceptionList</code> object