jaroslav@66: /*
jaroslav@66: * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
jaroslav@66: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@66: *
jaroslav@66: * This code is free software; you can redistribute it and/or modify it
jaroslav@66: * under the terms of the GNU General Public License version 2 only, as
jaroslav@66: * published by the Free Software Foundation. Oracle designates this
jaroslav@66: * particular file as subject to the "Classpath" exception as provided
jaroslav@66: * by Oracle in the LICENSE file that accompanied this code.
jaroslav@66: *
jaroslav@66: * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@66: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@66: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jaroslav@66: * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@66: * accompanied this code).
jaroslav@66: *
jaroslav@66: * You should have received a copy of the GNU General Public License version
jaroslav@66: * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@66: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@66: *
jaroslav@66: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@66: * or visit www.oracle.com if you need additional information or have any
jaroslav@66: * questions.
jaroslav@66: */
jaroslav@66:
jaroslav@66: package java.lang;
jaroslav@66:
jaroslav@66: /**
jaroslav@66: * Thrown by String
methods to indicate that an index
jaroslav@66: * is either negative or greater than the size of the string. For
jaroslav@66: * some methods such as the charAt method, this exception also is
jaroslav@66: * thrown when the index is equal to the size of the string.
jaroslav@66: *
jaroslav@66: * @author unascribed
jaroslav@66: * @see java.lang.String#charAt(int)
jaroslav@66: * @since JDK1.0
jaroslav@66: */
jaroslav@66: public
jaroslav@66: class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
jaroslav@66: private static final long serialVersionUID = -6762910422159637258L;
jaroslav@66:
jaroslav@66: /**
jaroslav@66: * Constructs a StringIndexOutOfBoundsException
with no
jaroslav@66: * detail message.
jaroslav@66: *
jaroslav@66: * @since JDK1.0.
jaroslav@66: */
jaroslav@66: public StringIndexOutOfBoundsException() {
jaroslav@66: super();
jaroslav@66: }
jaroslav@66:
jaroslav@66: /**
jaroslav@66: * Constructs a StringIndexOutOfBoundsException
with
jaroslav@66: * the specified detail message.
jaroslav@66: *
jaroslav@66: * @param s the detail message.
jaroslav@66: */
jaroslav@66: public StringIndexOutOfBoundsException(String s) {
jaroslav@66: super(s);
jaroslav@66: }
jaroslav@66:
jaroslav@66: /**
jaroslav@66: * Constructs a new StringIndexOutOfBoundsException
jaroslav@66: * class with an argument indicating the illegal index.
jaroslav@66: *
jaroslav@66: * @param index the illegal index.
jaroslav@66: */
jaroslav@66: public StringIndexOutOfBoundsException(int index) {
jaroslav@66: super("String index out of range: " + index);
jaroslav@66: }
jaroslav@66: }