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