1. /*
  2. * @(#)StringIndexOutOfBoundsException.java 1.18 00/02/02
  3. *
  4. * Copyright 1994-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 java.lang;
  11. /**
  12. * Thrown by the <code>charAt</code> method in class
  13. * <code>String</code> and by other <code>String</code>
  14. * methods to indicate that an index is either negative or greater
  15. * than or equal to the size of the string.
  16. *
  17. * @author unascribed
  18. * @version 1.18, 02/02/00
  19. * @see java.lang.String#charAt(int)
  20. * @since JDK1.0
  21. */
  22. public
  23. class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
  24. /**
  25. * Constructs a <code>StringIndexOutOfBoundsException</code> with no
  26. * detail message.
  27. *
  28. * @since JDK1.0.
  29. */
  30. public StringIndexOutOfBoundsException() {
  31. super();
  32. }
  33. /**
  34. * Constructs a <code>StringIndexOutOfBoundsException</code> with
  35. * the specified detail message.
  36. *
  37. * @param s the detail message.
  38. */
  39. public StringIndexOutOfBoundsException(String s) {
  40. super(s);
  41. }
  42. /**
  43. * Constructs a new <code>StringIndexOutOfBoundsException</code>
  44. * class with an argument indicating the illegal index.
  45. *
  46. * @param index the illegal index.
  47. */
  48. public StringIndexOutOfBoundsException(int index) {
  49. super("String index out of range: " + index);
  50. }
  51. }