01 
02 /*
03  *  JScripter Standard 1.0 - To Script In Java
04  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
05  *  
06  *  This program is free software: you can redistribute it and/or modify
07  *  it under the terms of the GNU Affero General Public License as published by
08  *  the Free Software Foundation, either version 3 of the License, or
09  *  (at your option) any later version.
10  *  
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU Affero General Public License for more details.
15  *  
16  *  You should have received a copy of the GNU Affero General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 package js;
21 
22 /**
23  * <p>An <b>opaque</b> class to construct an index ID which can be used as a field 
24  * identifier that is locally unique.</p>
25  *
26  * @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>
27  * 
28  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be 
29  * generated into the target codes. Re-compilers must exit with error on the operations of 
30  * accessing that kind of class objects.
31  */
32 
33 public final class Index<T> extends Id<T>
34 {
35     /**
36      * <p>The typical constructor to create an index that is locally unique with the 
37      * specified index value.</p>
38      * @param idx An argument string value that uniquely identifies the index in the 
39      * local context.
40      * @since 1.0
41      * @javascript Re-compilers must replace this constructor with the specified string 
42      * argument as field identifier.
43      */
44     public Index(String idx) {
45         super(idx);
46     }
47 
48     /**
49      * <p>The typical constructor to create an index that is locally unique with the 
50      * specified index value.</p>
51      * @param idx An argument integer value that uniquely identifies the index in the 
52      * local context.
53      * @since 1.0
54      * @javascript Re-compilers must replace this constructor with the specified integer 
55      * argument as field identifier.
56      */
57     public Index(int idx) {
58         super(Integer.toString(idx));
59     }
60 }