1. /*
  2. * @(#)ExceptionListImpl.java 1.26 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * Licensed Materials - Property of IBM
  9. * RMI-IIOP v1.0
  10. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  11. *
  12. * US Government Users Restricted Rights - Use, duplication or
  13. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. */
  15. package com.sun.corba.se.impl.corba;
  16. import java.util.Vector;
  17. import org.omg.CORBA.Bounds;
  18. import org.omg.CORBA.ExceptionList;
  19. import org.omg.CORBA.TypeCode;
  20. import org.omg.CORBA.ORB;
  21. public class ExceptionListImpl extends ExceptionList {
  22. private final int INITIAL_CAPACITY = 2;
  23. private final int CAPACITY_INCREMENT = 2;
  24. private Vector _exceptions;
  25. public ExceptionListImpl() {
  26. _exceptions = new Vector(INITIAL_CAPACITY, CAPACITY_INCREMENT);
  27. }
  28. public int count()
  29. {
  30. return _exceptions.size();
  31. }
  32. public void add(TypeCode tc)
  33. {
  34. _exceptions.addElement(tc);
  35. }
  36. public TypeCode item(int index)
  37. throws Bounds
  38. {
  39. try {
  40. return (TypeCode) _exceptions.elementAt(index);
  41. } catch (ArrayIndexOutOfBoundsException e) {
  42. throw new Bounds();
  43. }
  44. }
  45. public void remove(int index)
  46. throws Bounds
  47. {
  48. try {
  49. _exceptions.removeElementAt(index);
  50. } catch (ArrayIndexOutOfBoundsException e) {
  51. throw new Bounds();
  52. }
  53. }
  54. }