01 /*
02  *  JScripter Emulation 1.0 - To Script Java
03  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
04  *  
05  *  This program is free software: you can redistribute it and/or modify
06  *  it under the terms of the GNU Affero General Public License as published by
07  *  the Free Software Foundation, either version 3 of the License, or
08  *  (at your option) any later version.
09  *  
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *  
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.jscripter.emu.java.lang;
20 
21 import js.*;
22 
23 /**
24  * <p>An <b>internal</b> class of an exception thrown to indicate that an array has
25  * been accessed with an illegal index, emulating a standard <tt>java.lang</tt>
26  * interface or class with the same simple name as this one.</p>
27  * <p>This interface or class is only used internally by JS re-compiler implementations.</p>
28  * <p>Please refer to <a href="http://java.sun.com/docs/">the Java API Standards</a> for detail description of the original class or interface.</p>
29  * 
30  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
31  * 
32  * @javascript Re-compilers must redirect the resolution of the emulated original Java class or interface to this one.
33  */
34 public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException
35 {
36     /**
37      * <p>Internally constructs an exception of this type.</p>
38      * @since 1.0
39      * @javascript Re-compilers must report error on end-users directly using this constructor.
40      */
41     public ArrayIndexOutOfBoundsException() {
42         super();
43     }
44 
45     /**
46      * <p>Internally constructs an exception of this type with detail message.</p>
47      * @param message The detail message.
48      * @since 1.0
49      * @javascript Re-compilers must report error on end-users directly using this constructor.
50      */
51     public ArrayIndexOutOfBoundsException(java.lang.String message) {
52         super(message);
53     }
54 
55     /**
56      * <p>Internally constructs an exception of this type with an argument indicating the illegal index.</p>
57      * @param index The illegal index.
58      * @since 1.0
59      * @javascript Re-compilers must report error on end-users directly using this constructor.
60      */
61     public ArrayIndexOutOfBoundsException(int index) {
62         super(new Value.String("Array").add(" ").add("index").add(" ")
63                 .add(index).add(" ").add("out").add(" ").add("of").add(" ")
64                 .add("range").var());
65     }
66 }