Add StringIndexOutOfBoundsException and use it in String

This commit is contained in:
Simon Ochsenreither
2014-01-21 18:40:27 +01:00
parent d2cc630736
commit 4b54b30439
2 changed files with 80 additions and 44 deletions

View File

@ -0,0 +1,19 @@
package java.lang;
/**
* Used by <code>String</code> to signal that a given index is either less than
* or greater than the allowed range.
*/
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
private static final long serialVersionUID = -6762910422159637258L;
public StringIndexOutOfBoundsException(int index) {
super("String index out of range: "+index);
}
public StringIndexOutOfBoundsException(String message) {
super(message);
}
public StringIndexOutOfBoundsException() {}
}