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 used in Request
operations to
duke@1: * describe the exceptions that can be thrown by a method. It maintains a
duke@1: * modifiable list of TypeCode
s of the exceptions.
duke@1: *
duke@1: * The following code fragment demonstrates creating
duke@1: * an ExceptionList
object:
duke@1: *
duke@1: * ORB orb = ORB.init(args, null); duke@1: * org.omg.CORBA.ExceptionList excList = orb.create_exception_list(); duke@1: *duke@1: * The variable
excList
represents an ExceptionList
duke@1: * object with no TypeCode
objects in it.
duke@1: *
duke@1: * To add items to the list, you first create a TypeCode
object
duke@1: * for the exception you want to include, using the ORB
method
duke@1: * create_exception_tc
. Then you use the ExceptionList
duke@1: * method add
to add it to the list.
duke@1: * The class ExceptionList
has a method for getting
duke@1: * the number of TypeCode
objects in the list, and after
duke@1: * items have been added, it is possible to call methods for accessing
duke@1: * or deleting an item at a designated index.
duke@1: *
duke@1: * @since JDK1.2
duke@1: */
duke@1:
duke@1: public abstract class ExceptionList {
duke@1:
duke@1: /**
duke@1: * Retrieves the number of TypeCode
objects in this
duke@1: * ExceptionList
object.
duke@1: *
duke@1: * @return the number of TypeCode
objects in this
duke@1: * ExceptionList
object
duke@1: */
duke@1:
duke@1: public abstract int count();
duke@1:
duke@1: /**
duke@1: * Adds a TypeCode
object describing an exception
duke@1: * to this ExceptionList
object.
duke@1: *
duke@1: * @param exc the TypeCode
object to be added
duke@1: */
duke@1:
duke@1: public abstract void add(TypeCode exc);
duke@1:
duke@1: /**
duke@1: * Returns the TypeCode
object at the given index. The first
duke@1: * item is at index 0.
duke@1: *
duke@1: * @param index the index of the TypeCode
object desired.
duke@1: * This must be an int
between 0 and the
duke@1: * number of TypeCode
objects
duke@1: * minus one, inclusive.
duke@1: * @return the TypeCode
object at the given index
duke@1: * @exception org.omg.CORBA.Bounds if the index given is greater than
duke@1: * or equal to the number of TypeCode
objects
duke@1: * in this ExceptionList
object
duke@1: */
duke@1:
duke@1: public abstract TypeCode item(int index)
duke@1: throws org.omg.CORBA.Bounds;
duke@1:
duke@1: /**
duke@1: * Removes the TypeCode
object at the given index.
duke@1: * Note that the indices of all the TypeCoded
objects
duke@1: * following the one deleted are shifted down by one.
duke@1: *
duke@1: * @param index the index of the TypeCode
object to be
duke@1: * removed.
duke@1: * This must be an int
between 0 and the
duke@1: * number of TypeCode
objects
duke@1: * minus one, inclusive.
duke@1: *
duke@1: * @exception org.omg.CORBA.Bounds if the index is greater than
duke@1: * or equal to the number of TypeCode
objects
duke@1: * in this ExceptionList
object
duke@1: */
duke@1:
duke@1: public abstract void remove(int index)
duke@1: throws org.omg.CORBA.Bounds;
duke@1: }