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