1. /*
  2. * @(#)ExceptionList.java 1.24 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA;
  8. /**
  9. * An object used in <code>Request</code> operations to
  10. * describe the exceptions that can be thrown by a method. It maintains a
  11. * modifiable list of <code>TypeCode</code>s of the exceptions.
  12. * <P>
  13. * The following code fragment demonstrates creating
  14. * an <code>ExceptionList</code> object:
  15. * <PRE>
  16. * ORB orb = ORB.init(args, null);
  17. * org.omg.CORBA.ExceptionList excList = orb.create_exception_list();
  18. * </PRE>
  19. * The variable <code>excList</code> represents an <code>ExceptionList</code>
  20. * object with no <code>TypeCode</code> objects in it.
  21. * <P>
  22. * To add items to the list, you first create a <code>TypeCode</code> object
  23. * for the exception you want to include, using the <code>ORB</code> method
  24. * <code>create_exception_tc</code>. Then you use the <code>ExceptionList</code>
  25. * method <code>add</code> to add it to the list.
  26. * The class <code>ExceptionList</code> has a method for getting
  27. * the number of <code>TypeCode</code> objects in the list, and after
  28. * items have been added, it is possible to call methods for accessing
  29. * or deleting an item at a designated index.
  30. *
  31. * @version 1.13, 09/09/97
  32. * @since JDK1.2
  33. */
  34. public abstract class ExceptionList {
  35. /**
  36. * Retrieves the number of <code>TypeCode</code> objects in this
  37. * <code>ExceptionList</code> object.
  38. *
  39. * @return the number of <code>TypeCode</code> objects in this
  40. * <code>ExceptionList</code> object
  41. */
  42. public abstract int count();
  43. /**
  44. * Adds a <code>TypeCode</code> object describing an exception
  45. * to this <code>ExceptionList</code> object.
  46. *
  47. * @param exc the <code>TypeCode</code> object to be added
  48. */
  49. public abstract void add(TypeCode exc);
  50. /**
  51. * Returns the <code>TypeCode</code> object at the given index. The first
  52. * item is at index 0.
  53. *
  54. * @param index the index of the <code>TypeCode</code> object desired.
  55. * This must be an <code>int</code> between 0 and the
  56. * number of <code>TypeCode</code> objects
  57. * minus one, inclusive.
  58. * @return the <code>TypeCode</code> object at the given index
  59. * @exception org.omg.CORBA.Bounds if the index given is greater than
  60. * or equal to the number of <code>TypeCode</code> objects
  61. * in this <code>ExceptionList</code> object
  62. */
  63. public abstract TypeCode item(int index)
  64. throws org.omg.CORBA.Bounds;
  65. /**
  66. * Removes the <code>TypeCode</code> object at the given index.
  67. * Note that the indices of all the <code>TypeCoded</code> objects
  68. * following the one deleted are shifted down by one.
  69. *
  70. * @param index the index of the <code>TypeCode</code> object to be
  71. * removed.
  72. * This must be an <code>int</code> between 0 and the
  73. * number of <code>TypeCode</code> objects
  74. * minus one, inclusive.
  75. *
  76. * @exception org.omg.CORBA.Bounds if the index is greater than
  77. * or equal to the number of <code>TypeCode</code> objects
  78. * in this <code>ExceptionList</code> object
  79. */
  80. public abstract void remove(int index)
  81. throws org.omg.CORBA.Bounds;
  82. }