KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > StringIndexOutOfBoundsException


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
8 package java.lang;
9
10 /**
11  * Thrown by <code>String</code> methods to indicate that an index
12  * is either negative or greater than the size of the string. For
13  * some methods such as the charAt method, this exception also is
14  * thrown when the index is equal to the size of the string.
15  *
16  * @author unascribed
17  * @version 1.22, 12/19/03
18  * @see java.lang.String#charAt(int)
19  * @since JDK1.0
20  */

21 public
22 class StringIndexOutOfBoundsException extends IndexOutOfBoundsException JavaDoc {
23     /**
24      * Constructs a <code>StringIndexOutOfBoundsException</code> with no
25      * detail message.
26      *
27      * @since JDK1.0.
28      */

29     public StringIndexOutOfBoundsException() {
30     super();
31     }
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 JavaDoc s) {
40     super(s);
41     }
42
43     /**
44      * Constructs a new <code>StringIndexOutOfBoundsException</code>
45      * class with an argument indicating the illegal index.
46      *
47      * @param index the illegal index.
48      */

49     public StringIndexOutOfBoundsException(int index) {
50     super("String index out of range: " + index);
51     }
52 }
53
Popular Tags