0001 
0002 /*
0003  *  JScripter Standard 1.0 - To Script In Java
0004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
0005  *  
0006  *  This program is free software: you can redistribute it and/or modify
0007  *  it under the terms of the GNU Affero General Public License as published by
0008  *  the Free Software Foundation, either version 3 of the License, or
0009  *  (at your option) any later version.
0010  *  
0011  *  This program is distributed in the hope that it will be useful,
0012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  *  GNU Affero General Public License for more details.
0015  *  
0016  *  You should have received a copy of the GNU Affero General Public License
0017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 package js.core;
0021 
0022 import js.*;
0023 
0024 /**
0025  * <p>An <b>opaque</b> class representing JavaScript array objects.</p>
0026  *
0027  * @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>
0028  *
0029  * @see js.core.JsArray#JsArray()
0030  * @see js.core.JsArray#JsArray(js.core.JsObject)
0031  * @see js.core.JsArray#JsArray(Object[])
0032  * @see js.core.JsArray#JsArray(boolean[])
0033  * @see js.core.JsArray#JsArray(byte[])
0034  * @see js.core.JsArray#JsArray(char[])
0035  * @see js.core.JsArray#JsArray(short[])
0036  * @see js.core.JsArray#JsArray(int[])
0037  * @see js.core.JsArray#JsArray(long[])
0038  * @see js.core.JsArray#JsArray(float[])
0039  * @see js.core.JsArray#JsArray(double[])
0040  * @see js.core.JsGlobal.Array#create()
0041  * @see js.core.JsGlobal.Array#create(Object)
0042  * @see js.core.JsGlobal.Array#create(Vars)
0043  * @see jsx.core.ArrayLikes
0044  * 
0045  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be 
0046  * generated into the target codes. Re-compilers must exit with error on the operations of 
0047  * accessing that kind of class objects.
0048  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored 
0049  * and <tt>instanceof</tt> to it always <tt>true</tt>.
0050  */
0051 public class JsArray extends JsGlobal.Array.Prototype implements ArrayLike<Object>
0052 {
0053     /**
0054      * <p>An <b>internal</b> class containing membership data for its enclosing 
0055      * opaque class.</p>
0056      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or 
0057      * class members.</p>
0058      *
0059      * @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>
0060      * 
0061      * @javascript Re-compilers must report error on resolving an <b>internal</b> class. 
0062      */
0063     protected static abstract class Members extends JsGlobal.Array.Prototype.Members
0064     {
0065         /**
0066          * <p>An <b>internal</b> static field defining a member ID of the field name and 
0067          * used internally to define a member of the same name.</p>
0068          * @since 1.0
0069          * @see JsArray#index
0070          * @see Member#index
0071          * @javascript Re-compilers must report error on accessing an <b>internal</b> field. 
0072          */
0073         public final static Mid index  = id("index" );
0074         /**
0075          * <p>An <b>internal</b> static field defining a member ID of the field name and 
0076          * used internally to define a member of the same name.</p>
0077          * @since 1.0
0078          * @see JsArray#input
0079          * @see Member#input
0080          * @javascript Re-compilers must report error on accessing an <b>internal</b> field. 
0081          */
0082         public final static Mid input  = id("input" );
0083         /**
0084          * <p>An <b>internal</b> static field defining a member ID of the field name and 
0085          * used internally to define a member of the same name.</p>
0086          * @since 1.0
0087          * @see JsArray#length
0088          * @see Member#length
0089          * @javascript Re-compilers must report error on accessing an <b>internal</b> field. 
0090          */
0091         public final static Mid length = id("length");
0092     }
0093 
0094     /**
0095      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
0096      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
0097      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
0098      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
0099      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
0100      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
0101      * either circumstance, the field names must be exactly same as the member names, as 
0102      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
0103      * based on the field names.</p>
0104      *
0105      * @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>
0106      * 
0107      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created 
0108      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
0109      * of class objects.
0110      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in 
0111      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
0112      * <pre>q.m</pre>
0113      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier 
0114      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
0115      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
0116      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
0117      * <pre>m</pre>
0118      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report 
0119      * error on the access to <b>opaque</b> fields declared by this class under any other 
0120      * circumstances.
0121      */
0122     public static class Member extends JsGlobal.Array.Prototype.Member
0123     {
0124         /**
0125          * <p>Internally constructs a member based on a qualifying member.</p>
0126          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> 
0127          * or <b>internal</b> classes or class members.</p>
0128          * <p>Note that, this constructor is <b>internal</b> but its declaring class is 
0129          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
0130          * declared in the declaring class of this constructor itself or its subclasses. 
0131          * Under this circumstance, the field names must be exactly same as the member 
0132          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
0133          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly 
0134          * to their names appending to the name resolved from the specified qualifying 
0135          * member with a dot in between.</p>
0136          * @param q A qualifying member
0137          * @param mid The ID of the member to construct
0138          * @since 1.0
0139          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0140          */
0141         public Member(JsObject.Member q, Mid mid) {
0142             super(q, mid);
0143         }
0144         /**
0145          * <p>Internally constructs a member without a qualifying member.</p>
0146          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> 
0147          * or <b>internal</b> classes or class members.</p>
0148          * <p>Note that, this constructor is <b>internal</b> but its declaring class is 
0149          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
0150          * declared in <b>opaque</b> types other than the declaring class of this constructor 
0151          * itself and its subclasses. Under this circumstance, the field names must be 
0152          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b> 
0153          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
0154          * @param mid The ID of the member to construct
0155          * @since 1.0
0156          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0157          */
0158         public Member(Mid mid) {
0159             super(mid);
0160         }
0161         /**
0162          * <p>Evaluates the property, represented by the current member instance, of the 
0163          * argument object.</p>
0164          * @param o The argument object
0165          * @return The value of the current member based on the object argument.
0166          * @since 1.0
0167          * @javascript Re-compilers must convert the instance invocation of this method into 
0168          * the JavaScript expression: 
0169          * <pre>o.m</pre>
0170          * where <tt>m</tt> is the identifier name resolved from the current member 
0171          * instance of the invocation.
0172          */
0173         @Override
0174         public JsArray with(ObjectLike o) {
0175             return new JsArray((JsObject)var(o).var(mid()));
0176         }
0177 
0178         /**
0179          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the 
0180          * name of this field, qualified by the current member instance of the field, and 
0181          * to access the property of the name on an object.</p>
0182          * <p>The <tt>constructor</tt> property of an object is a reference to the function 
0183          * that was the constructor for that object.</p>
0184          * <p>A common use of the <tt>constructor</tt> property is to determine the type of unknown 
0185          * objects. Given an unknown value, you can use the {@link js.Js#typeof(Object)} operation 
0186          * to determine whether it is a primitive value or an object. If it is an object, you can 
0187          * use the <tt>constructor</tt> property to determine what type of object it is.</p>
0188          * <p>Note, however, that while this technique works for the objects built into core 
0189          * JavaScript, it is not guaranteed to work with host objects such as the <tt>window</tt> 
0190          * object of client-side JavaScript. The default implementation of the <tt>toString()</tt> 
0191          * method provides another way to determine the type of an unknown object.</p>
0192          * @since 1.0
0193          * @javascript Re-compilers must resolve the member of this instance field to the 
0194          * identifier of the field name appending to the identifier resolved from its 
0195          * qualifying member with a dot in between.
0196          */
0197         public final JsFunction.Member<JsArray> constructor = new JsFunction.Member<JsArray>(this, Members.constructor, Generic.get(JsArray.class)); 
0198         /**
0199          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the 
0200          * name of this field, qualified by the current member instance of the field, and 
0201          * to access the property of the name on an object.</p>
0202          * @since 1.0
0203          * @see JsArray#index()
0204          * @javascript Re-compilers must resolve the member of this instance field to the 
0205          * identifier of the field name appending to the identifier resolved from its 
0206          * qualifying member with a dot in between.
0207          */
0208         public final Value.Integer.Member index  = new Value.Integer.Member(this, Members.index );
0209         /**
0210          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the 
0211          * name of this field, qualified by the current member instance of the field, and 
0212          * to access the property of the name on an object.</p>
0213          * @since 1.0
0214          * @see JsArray#input()
0215          * @javascript Re-compilers must resolve the member of this instance field to the 
0216          * identifier of the field name appending to the identifier resolved from its 
0217          * qualifying member with a dot in between.
0218          */
0219         public final Value.String .Member input  = new Value.String .Member(this, Members.input );
0220         /**
0221          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the 
0222          * name of this field, qualified by the current member instance of the field, and 
0223          * to access the property of the name on an object.</p>
0224          * @see JsArray#length()
0225          * @since 1.0
0226          * @javascript Re-compilers must resolve the member of this instance field to the 
0227          * identifier of the field name appending to the identifier resolved from its 
0228          * qualifying member with a dot in between.
0229          */
0230         public final Value.Number .Member length = new Value.Number .Member(this, Members.length);
0231     }
0232 
0233     /**
0234      * <p>Internally constructs an array object.</p>
0235      * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> or 
0236      * <b>internal</b> classes or class members.</p>
0237      * <p>Note that, The Java class <tt>java.lang.String</tt> and Java basic classes that 
0238      * wrap primitive data types are also "primitive" to JS.</p>
0239      * @since 1.0
0240      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0241      */
0242     protected JsArray(Object var) {
0243         super((JsObject)var);
0244     }
0245     /**
0246      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it 
0247      * with the wrapping constructor.</p>
0248      * @param var The argument of an <b>opaque</b> object.
0249      * @since 1.0
0250      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0251      * that is, replacing it with its only argument.
0252      */
0253     public JsArray(JsObject var) {
0254         super(var(var, (JsArray)null));
0255     }
0256     /**
0257      * <p>Constructs an empty array object.</p>
0258      * @since 1.0
0259      * @see #JsArray(js.core.JsObject)
0260      * @see #JsArray(Object[])
0261      * @see #JsArray(boolean[])
0262      * @see #JsArray(byte[])
0263      * @see #JsArray(char[])
0264      * @see #JsArray(short[])
0265      * @see #JsArray(int[])
0266      * @see #JsArray(long[])
0267      * @see #JsArray(float[])
0268      * @see #JsArray(double[])
0269      * @see js.core.JsGlobal.Array#create()
0270      * @see js.core.JsGlobal.Array#create(Object)
0271      * @see js.core.JsGlobal.Array#create(Vars)
0272      * @see jsx.core.ArrayLikes
0273      * @javascript Re-compilers must replace the construction operation of this constructor 
0274      * with the JavaScript expression:
0275      * <pre>new Array()</pre>
0276      */
0277     public JsArray() {
0278         this(JsGlobal.Array.with().invoke());
0279     }
0280     /**
0281      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0282      * wrapping constructor.</p>
0283      * @param arr The argument of an array.
0284      * @since 1.0
0285      * @see #JsArray()
0286      * @see #JsArray(js.core.JsObject)
0287      * @see #JsArray(boolean[])
0288      * @see #JsArray(byte[])
0289      * @see #JsArray(char[])
0290      * @see #JsArray(short[])
0291      * @see #JsArray(int[])
0292      * @see #JsArray(long[])
0293      * @see #JsArray(float[])
0294      * @see #JsArray(double[])
0295      * @see js.core.JsGlobal.Array#create()
0296      * @see js.core.JsGlobal.Array#create(Object)
0297      * @see js.core.JsGlobal.Array#create(Vars)
0298      * @see jsx.core.ArrayLikes
0299      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0300      * that is, replacing it with its only argument.
0301      */
0302     public <T> JsArray(T[] arr) {
0303         this(JsGlobal.Array.with().invoke(arr));
0304     }
0305     /**
0306      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0307      * wrapping constructor.</p>
0308      * @param arr The argument of an array.
0309      * @since 1.0
0310      * @see #JsArray()
0311      * @see #JsArray(js.core.JsObject)
0312      * @see #JsArray(Object[])
0313      * @see #JsArray(byte[])
0314      * @see #JsArray(char[])
0315      * @see #JsArray(short[])
0316      * @see #JsArray(int[])
0317      * @see #JsArray(long[])
0318      * @see #JsArray(float[])
0319      * @see #JsArray(double[])
0320      * @see js.core.JsGlobal.Array#create()
0321      * @see js.core.JsGlobal.Array#create(Object)
0322      * @see js.core.JsGlobal.Array#create(Vars)
0323      * @see jsx.core.ArrayLikes
0324      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0325      * that is, replacing it with its only argument.
0326      */
0327     public JsArray(boolean[] arr) {
0328         this(JsGlobal.Array.with().invoke(arr));
0329     }
0330     /**
0331      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0332      * wrapping constructor.</p>
0333      * @param arr The argument of an array.
0334      * @since 1.0
0335      * @see #JsArray()
0336      * @see #JsArray(js.core.JsObject)
0337      * @see #JsArray(Object[])
0338      * @see #JsArray(boolean[])
0339      * @see #JsArray(char[])
0340      * @see #JsArray(short[])
0341      * @see #JsArray(int[])
0342      * @see #JsArray(long[])
0343      * @see #JsArray(float[])
0344      * @see #JsArray(double[])
0345      * @see js.core.JsGlobal.Array#create()
0346      * @see js.core.JsGlobal.Array#create(Object)
0347      * @see js.core.JsGlobal.Array#create(Vars)
0348      * @see jsx.core.ArrayLikes
0349      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0350      * that is, replacing it with its only argument.
0351      */
0352     public JsArray(byte[] arr) {
0353         this(JsGlobal.Array.with().invoke(arr));
0354     }
0355     /**
0356      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0357      * wrapping constructor.</p>
0358      * @param arr The argument of an array.
0359      * @since 1.0
0360      * @see #JsArray()
0361      * @see #JsArray(js.core.JsObject)
0362      * @see #JsArray(Object[])
0363      * @see #JsArray(boolean[])
0364      * @see #JsArray(byte[])
0365      * @see #JsArray(short[])
0366      * @see #JsArray(int[])
0367      * @see #JsArray(long[])
0368      * @see #JsArray(float[])
0369      * @see #JsArray(double[])
0370      * @see js.core.JsGlobal.Array#create()
0371      * @see js.core.JsGlobal.Array#create(Object)
0372      * @see js.core.JsGlobal.Array#create(Vars)
0373      * @see jsx.core.ArrayLikes
0374      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0375      * that is, replacing it with its only argument.
0376      */
0377     public JsArray(char[] arr) {
0378         this(JsGlobal.Array.with().invoke(arr));
0379     }
0380     /**
0381      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0382      * wrapping constructor.</p>
0383      * @param arr The argument of an array.
0384      * @since 1.0
0385      * @see #JsArray()
0386      * @see #JsArray(js.core.JsObject)
0387      * @see #JsArray(Object[])
0388      * @see #JsArray(boolean[])
0389      * @see #JsArray(byte[])
0390      * @see #JsArray(char[])
0391      * @see #JsArray(int[])
0392      * @see #JsArray(long[])
0393      * @see #JsArray(float[])
0394      * @see #JsArray(double[])
0395      * @see js.core.JsGlobal.Array#create()
0396      * @see js.core.JsGlobal.Array#create(Object)
0397      * @see js.core.JsGlobal.Array#create(Vars)
0398      * @see jsx.core.ArrayLikes
0399      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0400      * that is, replacing it with its only argument.
0401      */
0402     public JsArray(short[] arr) {
0403         this(JsGlobal.Array.with().invoke(arr));
0404     }
0405     /**
0406      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0407      * wrapping constructor.</p>
0408      * @param arr The argument of an array.
0409      * @since 1.0
0410      * @see #JsArray()
0411      * @see #JsArray(js.core.JsObject)
0412      * @see #JsArray(Object[])
0413      * @see #JsArray(boolean[])
0414      * @see #JsArray(byte[])
0415      * @see #JsArray(char[])
0416      * @see #JsArray(short[])
0417      * @see #JsArray(long[])
0418      * @see #JsArray(float[])
0419      * @see #JsArray(double[])
0420      * @see js.core.JsGlobal.Array#create()
0421      * @see js.core.JsGlobal.Array#create(Object)
0422      * @see js.core.JsGlobal.Array#create(Vars)
0423      * @see jsx.core.ArrayLikes
0424      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0425      * that is, replacing it with its only argument.
0426      */
0427     public JsArray(int[] arr) {
0428         this(JsGlobal.Array.with().invoke(arr));
0429     }
0430     /**
0431      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0432      * wrapping constructor.</p>
0433      * @param arr The argument of an array.
0434      * @since 1.0
0435      * @see #JsArray()
0436      * @see #JsArray(js.core.JsObject)
0437      * @see #JsArray(Object[])
0438      * @see #JsArray(boolean[])
0439      * @see #JsArray(byte[])
0440      * @see #JsArray(char[])
0441      * @see #JsArray(short[])
0442      * @see #JsArray(int[])
0443      * @see #JsArray(float[])
0444      * @see #JsArray(double[])
0445      * @see js.core.JsGlobal.Array#create()
0446      * @see js.core.JsGlobal.Array#create(Object)
0447      * @see js.core.JsGlobal.Array#create(Vars)
0448      * @see jsx.core.ArrayLikes
0449      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0450      * that is, replacing it with its only argument.
0451      */
0452     public JsArray(long[] arr) {
0453         this(JsGlobal.Array.with().invoke(arr));
0454     }
0455     /**
0456      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0457      * wrapping constructor.</p>
0458      * @param arr The argument of an array.
0459      * @since 1.0
0460      * @see #JsArray()
0461      * @see #JsArray(js.core.JsObject)
0462      * @see #JsArray(Object[])
0463      * @see #JsArray(boolean[])
0464      * @see #JsArray(byte[])
0465      * @see #JsArray(char[])
0466      * @see #JsArray(short[])
0467      * @see #JsArray(int[])
0468      * @see #JsArray(long[])
0469      * @see #JsArray(double[])
0470      * @see js.core.JsGlobal.Array#create()
0471      * @see js.core.JsGlobal.Array#create(Object)
0472      * @see js.core.JsGlobal.Array#create(Vars)
0473      * @see jsx.core.ArrayLikes
0474      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0475      * that is, replacing it with its only argument.
0476      */
0477     public JsArray(float[] arr) {
0478         this(JsGlobal.Array.with().invoke(arr));
0479     }
0480     /**
0481      * <p>Casts an array to the current <b>opaque</b> type by wrapping it with the 
0482      * wrapping constructor.</p>
0483      * @param arr The argument of an array.
0484      * @since 1.0
0485      * @see #JsArray()
0486      * @see #JsArray(js.core.JsObject)
0487      * @see #JsArray(Object[])
0488      * @see #JsArray(boolean[])
0489      * @see #JsArray(byte[])
0490      * @see #JsArray(char[])
0491      * @see #JsArray(short[])
0492      * @see #JsArray(int[])
0493      * @see #JsArray(long[])
0494      * @see #JsArray(float[])
0495      * @see js.core.JsGlobal.Array#create()
0496      * @see js.core.JsGlobal.Array#create(Object)
0497      * @see js.core.JsGlobal.Array#create(Vars)
0498      * @see jsx.core.ArrayLikes
0499      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0500      * that is, replacing it with its only argument.
0501      */
0502     public JsArray(double[] arr) {
0503         this(JsGlobal.Array.with().invoke(arr));
0504     }
0505 
0506     /**
0507      * <p>Simply returns the current array instance.</p>
0508      * <p>This method is useful for JS Simulation to implement opaque types.</p>
0509      * <p>If the current instance is a Java simulated array and the method runs in JS 
0510      * Embed Simulation mode, the invocation creates and returns a JavaScript Array object 
0511      * as a runtime copy of the current array.</p>
0512      * @return The current array instance.
0513      * @since 1.0
0514      * @javascript Re-compilers must ignore the instance invocation of this method, that is, 
0515      * replacing it with its current instance.
0516      */
0517     @Override
0518     public JsArray var() {
0519         return (JsArray)super.var();
0520     }
0521     /**
0522      * <p>Assigns the reference of another array to the current array instance.</p>
0523      * @param var The argument array instance.
0524      * @return The new array.
0525      * @since 1.0
0526      * @javascript Re-compilers must convert the instance invocation of this method into 
0527      * the JavaScript expression: 
0528      * <pre>a = var</pre>
0529      * where <tt>a</tt> is the current array instance of the invocation of this method.
0530      */
0531     @Override
0532     public final <S extends JsObject> S var(S var) {
0533         var(var, (JsArray)null);
0534         return var;
0535     }
0536 
0537     /**
0538      * <p>An <b>opaque</b> static field defining a member that is named by the field name 
0539      * without a qualifying member and to access the property of the name on an object.</p>
0540      * <p>The <tt>constructor</tt> property of an object is a reference to the function 
0541      * that was the constructor for that object.</p>
0542      * <p>A common use of the <tt>constructor</tt> property is to determine the type of unknown 
0543      * objects. Given an unknown value, you can use the {@link js.Js#typeof(Object)} operation 
0544      * to determine whether it is a primitive value or an object. If it is an object, you can 
0545      * use the <tt>constructor</tt> property to determine what type of object it is.</p>
0546      * <p>Note, however, that while this technique works for the objects built into core 
0547      * JavaScript, it is not guaranteed to work with host objects such as the <tt>window</tt> 
0548      * object of client-side JavaScript. The default implementation of the <tt>toString()</tt> 
0549      * method provides another way to determine the type of an unknown object.</p>
0550      * @since 1.0
0551      * @javascript Re-compilers must resolve the member of this static field to the 
0552      * identifier of the field name.
0553      */
0554     public static final JsFunction.Member<JsArray> constructor = new JsFunction.Member<JsArray>(Members.constructor, Generic.get(JsArray.class)); 
0555     /**
0556      * <p>An <b>opaque</b> static field defining a member that is named by the field name 
0557      * without a qualifying member and to access the property of the name on an object.</p>
0558      * @since 1.0
0559      * @see JsArray#index()
0560      * @javascript Re-compilers must resolve the member of this static field to the 
0561      * identifier of the field name.
0562      */
0563     public static final Value.Integer.Member index  = new Value.Integer.Member(Members.index );
0564     /**
0565      * <p>An <b>opaque</b> static field defining a member that is named by the field name 
0566      * without a qualifying member and to access the property of the name on an object.</p>
0567      * @since 1.0
0568      * @see JsArray#input()
0569      * @javascript Re-compilers must resolve the member of this static field to the 
0570      * identifier of the field name.
0571      */
0572     public static final Value.String .Member  input = new Value.String .Member(Members.input );
0573     /**
0574      * <p>An <b>opaque</b> static field defining a member that is named by the field name 
0575      * without a qualifying member and to access the property of the name on an object.</p>
0576      * @since 1.0
0577      * @see JsArray#length()
0578      * @javascript Re-compilers must resolve the member of this static field to the 
0579      * identifier of the field name.
0580      */
0581     public static final Value.Number .Member length = new Value.Number .Member(Members.length);
0582 
0583     /**
0584      * <p>Reads an element of the current array instance.</p>
0585      * @param i Array index of the element
0586      * @return value of the element
0587      * @since 1.0
0588      * @javascript Re-compilers must convert the instance invocation of this method into the 
0589      * JavaScript expression: 
0590      * <pre>a[i]</pre>
0591      * where <tt>a</tt> is the current array instance of the invocation.
0592      */
0593     public Object get(int i) {
0594         return var().get(i);
0595     }
0596     /**
0597      * <p>Writes an element of the current array instance.</p>
0598      * @param i Array index of the element
0599      * @param v The new value
0600      * @return The new value of the element
0601      * @see ArrayObject#get(int)
0602      * @since 1.0
0603      * @javascript Re-compilers must convert the instance invocation of this method into the 
0604      * JavaScript expression: 
0605      * <pre>(a[i]=v)</pre>
0606      * where <tt>a</tt> is the current array instance of the invocation.
0607      */
0608     public Object set(int i, Object v) {
0609         return var().set(i, v);
0610     }
0611     /**
0612      * <p>Deletes an element of the current array instance.</p>
0613      * @param i Array index of the element
0614      * @return <tt>true</tt> if the deletion is successful, <tt>false</tt> otherwise.
0615      * @see #set(int, Object)
0616      * @see jsx.core.ArrayLikes#delete(ArrayLike, int)
0617      * @since 1.0
0618      * @javascript Re-compilers must convert the instance invocation of this method into the 
0619      * JavaScript expression: 
0620      * <pre>(delete a[i])</pre>
0621      * where <tt>a</tt> is the current array instance of the invocation.
0622      */
0623     public boolean delete(int i) {
0624         return var().delete(i);
0625     }
0626     /**
0627      * <p>Gets the size of the current array instance.</p>
0628      * @return size of the array
0629      * @see jsx.core.ArrayLikes#length(ArrayObject)
0630      * @since 1.0
0631      * @javascript Re-compilers must convert the instance invocation of this method into the 
0632      * JavaScript expression: 
0633      * <pre>a.length</pre>
0634      * where <tt>a</tt> is the current array instance of the invocation.
0635      */
0636     public final int length() {
0637         return length.with(this).intValue();
0638     }
0639     /**
0640      * <p>Changes the size of the current array instance.</p>
0641      * @param len New size
0642      * @return New size
0643      * @see jsx.core.ArrayLikes#length(ArrayLike, int)
0644      * @since 1.0
0645      * @javascript Re-compilers must convert the instance invocation of this method into the 
0646      * JavaScript expression: 
0647      * <pre>(a.length=len)</pre>
0648      * where <tt>a</tt> is the current array instance of the invocation.
0649      */
0650     public final int length(int len) {
0651         return length.with(this, len).intValue();
0652     }
0653     /**
0654      * <p>Gets the <tt>index</tt> field of the current array instance.</p>
0655      * @return The value of the <tt>index</tt> field of an array object
0656      * @see StringLike#match(RegExpLike)
0657      * @see jsx.core.ArrayLikes#index(ArrayLike)
0658      * @since 1.0
0659      * @javascript Re-compilers must convert the instance invocation of this method into the 
0660      * JavaScript expression: 
0661      * <pre>a.index</pre>
0662      * where <tt>a</tt> is the current array instance of the invocation.
0663      */
0664     public final Integer index() {
0665         return index.with(this);
0666     }
0667     /**
0668      * <p>Gets the <tt>input</tt> field of the current array instance.</p>
0669      * @return The value of the <tt>input</tt> field of an array object
0670      * @see StringLike#match(RegExpLike)
0671      * @see RegExpLike#exec(Object)
0672      * @see jsx.core.ArrayLikes#input(ArrayLike)
0673      * @since 1.0
0674      * @javascript Re-compilers must convert the instance invocation of this method into the 
0675      * JavaScript expression: 
0676      * <pre>a.input</pre>
0677      * where <tt>a</tt> is the current array instance of the invocation.
0678      */
0679     public final String input() {
0680         return input.with(this);
0681     }
0682 
0683     /**
0684      * <p>Creates and returns a new array object that is the result of concatenating its
0685      * argument to the current array instance. This invocation does not modify the current 
0686      * array. If the argument to <tt>concat</tt> is itself an array, the elements of that array 
0687      * are concatenated, rather than the array itself.</p>
0688      * @param arg A value to be concatenated with the current array.
0689      * @return A new array object, which is formed by concatenating the specified argument
0690      * to the current array.
0691      * @see #concat(Vars)
0692      * @see jsx.core.ArrayLikes#concat(ArrayLike, Object)
0693      * @since 1.0
0694      * @javascript Re-compilers must convert the instance invocation of this method directly 
0695      * into a JavaScript invocation on its current array instance without changing the 
0696      * method name, but expanding variable arguments, if any, into comma-separated values. 
0697      */
0698     public final JsArray concat(Object arg) {
0699         return new JsArray(call(concat, arg));
0700     }
0701     /**
0702      * <p>Creates and returns a new array object that is the result of concatenating each 
0703      * of its arguments to the current array instance. This invocation does not modify the 
0704      * current array. If any of the arguments to <tt>concat</tt> is itself an array, 
0705      * the elements of that array are concatenated, rather than the array itself.</p>
0706      * @param args A list of the argument values to be concatenated with the current array.
0707      * @return A new array object, which is formed by concatenating each of the specified
0708      * arguments to the current array.
0709      * @see #concat(Object)
0710      * @since 1.0
0711      * @javascript Re-compilers must convert the instance invocation of this method directly 
0712      * into a JavaScript invocation on its current array instance without changing the 
0713      * method name, but expanding variable arguments, if any, into comma-separated values. 
0714      */
0715     public final JsArray concat(Vars<?> args) {
0716         return new JsArray(call(concat, args));
0717     }
0718     /**
0719      * <p>Converts each element of the current array instance to a string and then 
0720      * concatenates those strings, inserting a comma between the elements and returns 
0721      * the resulting string.</p>
0722      * @return The string that results from converting each element of the current array
0723      * to a string and then concatenating them together with a comma between elements.
0724      * @see #join(Object)
0725      * @see StringLike#split(Object)
0726      * @see jsx.core.ArrayLikes#join(ArrayLike)
0727      * @since 1.0
0728      * @javascript Re-compilers must convert the instance invocation of this method directly 
0729      * into a JavaScript invocation on its current array instance without changing the 
0730      * method name, but expanding variable arguments, if any, into comma-separated values. 
0731      */
0732     public final String join() {
0733         return call(join);
0734     }
0735     /**
0736      * <p>Converts each element of the current array instance to a string and then 
0737      * concatenates those strings, inserting the separator string specified by 
0738      * <tt>separator</tt> between the elements and returns the resulting string.</p>
0739      * @param separator An optional string used to separate one element of the current array
0740      * from the next in the returned string. If this argument is omitted, 
0741      * <tt>undefined</tt> or <tt>null</tt>, a comma is used.
0742      * @return The string that results from converting each element of the current array
0743      * to a string and then concatenating them together, with the <tt>separator</tt>
0744      * string between elements.
0745      * @see StringLike#split(Object)
0746      * @see jsx.core.ArrayLikes#join(ArrayLike, Object)
0747      * @since 1.0
0748      * @javascript Re-compilers must convert the instance invocation of this method directly 
0749      * into a JavaScript invocation on its current array instance without changing the 
0750      * method name, but expanding variable arguments, if any, into comma-separated values. 
0751      */
0752     public final String join(Object separator) {
0753         return call(join, separator);
0754     }
0755     /**
0756      * <p>Deletes the last element of the current array instance, decrements the length of 
0757      * the current array, and returns the value of the deleted element. If the current array is 
0758      * already empty, this invocation does not change the array and returns the undefined <tt>null</tt> value.</p>
0759      * @return The last element of the current array.
0760      * @see #push(Object)
0761      * @see #push(Vars)
0762      * @see jsx.core.ArrayLikes#pop(ArrayLike)
0763      * @since 1.0
0764      * @javascript Re-compilers must convert the instance invocation of this method directly 
0765      * into a JavaScript invocation on its current array instance without changing the 
0766      * method name, but expanding variable arguments, if any, into comma-separated values. 
0767      */
0768     public final Object pop() {
0769         return call(pop);
0770     }
0771     /**
0772      * <p>Appends the argument to the end of the current array instance by modifying the 
0773      * array directly rather than creating a new one.</p>
0774      * @param v A value to be appended to the end of the current array.
0775      * @return The new length of the array, after the specified value are appended to it.
0776      * @see #push(Vars)
0777      * @see #pop()
0778      * @see jsx.core.ArrayLikes#push(ArrayLike, Object)
0779      * @since 1.0
0780      * @javascript Re-compilers must convert the instance invocation of this method directly 
0781      * into a JavaScript invocation on its current array instance without changing the 
0782      * method name, but expanding variable arguments, if any, into comma-separated values. 
0783      */
0784     public final int push(Object v) {
0785         return call(push, v).intValue();
0786     }
0787     /**
0788      * <p>Appends the arguments, in order, to the end of the current array instance by 
0789      * modifying the array directly rather than creating a new one.</p>
0790      * @param args A list of the values to be appended to the end of the current array.
0791      * @return The new length of the array, after the specified values are appended to it.
0792      * @see #push(Object)
0793      * @see #pop()
0794      * @since 1.0
0795      * @javascript Re-compilers must convert the instance invocation of this method directly 
0796      * into a JavaScript invocation on its current array instance without changing the 
0797      * method name, but expanding variable arguments, if any, into comma-separated values. 
0798      */
0799     public final int push(Vars<?> args) {
0800         return call(push, args).intValue();
0801     }
0802     /**
0803      * <p>Reverses the order of the elements of the current array instance by rearranging 
0804      * them in place without creating a new array. If there are multiple references to the 
0805      * array, the new order of the array elements is visible through all references after 
0806      * this invocation.</p>
0807      * @see jsx.core.ArrayLikes#reverse(ArrayLike)
0808      * @since 1.0
0809      * @javascript Re-compilers must convert the instance invocation of this method directly 
0810      * into a JavaScript invocation on its current array instance without changing the 
0811      * method name, but expanding variable arguments, if any, into comma-separated values. 
0812      */
0813     public final void reverse() {
0814         call(reverse);
0815     }
0816     /**
0817      * <p>Removes and returns the first element of the current array instance, shifting 
0818      * all subsequent elements down one place to occupy the newly vacant space at the 
0819      * start of the array. If the current array is empty, this invocation does nothing 
0820      * and returns the undefined value <tt>null</tt>. Note that this invocation does 
0821      * not create a new array; instead, it modifies the current array directly.</p>
0822      * @return The former first element of the current array.
0823      * @see #pop()
0824      * @see jsx.core.ArrayLikes#shift(ArrayLike)
0825      * @since 1.0
0826      * @javascript Re-compilers must convert the instance invocation of this method directly 
0827      * into a JavaScript invocation on its current array instance without changing the 
0828      * method name, but expanding variable arguments, if any, into comma-separated values. 
0829      */
0830     public final Object shift() {
0831         return call(shift);
0832     }
0833     /**
0834      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
0835      * it. The returned array contains the element positioned by the first value of the 
0836      * argument list and all subsequent elements up to, but not including, the element 
0837      * positioned by the second value of the argument list. If the second value is not 
0838      * specified or undefined, the returned array contains all elements from the position 
0839      * specified by the first value to the end of the current array.</p>
0840      * @param args A list of the argument values. The first value specifies the array 
0841      * index at which the slice is to begin. If this value is negative, it specifies a 
0842      * position measured from the end of the current array. That is, -1 indicates the 
0843      * last element, -2 indicates the next from the last element, and so on. The second 
0844      * value specifies the array index immediately after the end of the slice. If it is 
0845      * undefined or not specified, the slice includes all array elements from the position 
0846      * specified by the first value to the end of the array. If the second value is 
0847      * negative, it specifies the array element measured from the end of the array.
0848      * @return A new array that contains the elements of current array instance from the 
0849      * element positioned by the first value of <tt>args</tt>, up to, but not including, 
0850      * the element positioned by the second value of <tt>args</tt>.
0851      * @see #slice(Object)
0852      * @see #slice(Object, Object)
0853      * @see #splice(Object)
0854      * @see #splice(Vars)
0855      * @see #splice(Object, Object)
0856      * @see #splice(Object, Object, Object)
0857      * @see #splice(Object, Object, Vars)
0858      * @since 1.0
0859      * @javascript Re-compilers must convert the instance invocation of this method directly 
0860      * into a JavaScript invocation on its current array instance without changing the 
0861      * method name, but expanding variable arguments, if any, into comma-separated values. 
0862      */
0863     public final JsArray slice(Vars<?> args) {
0864         return new JsArray(call(slice, args));
0865     }
0866     /**
0867      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
0868      * it. The returned array contains the element positioned by <tt>start</tt> and 
0869      * all subsequent elements up to the end of the current array.</p>
0870      * @param start The array index at which the slice is to begin. If negative, this 
0871      * argument specifies a position measured from the end of the current array. That is, 
0872      * -1 indicates the last element, -2 indicates the next from the last element, and so on.
0873      * @return A new array that contains the elements of current array instance from the 
0874      * element positioned by <tt>start</tt>, up to the end of the current array.
0875      * @see #slice(Object, Object)
0876      * @see #slice(Vars)
0877      * @see #splice(Object)
0878      * @see #splice(Vars)
0879      * @see #splice(Object, Object)
0880      * @see #splice(Object, Object, Object)
0881      * @see #splice(Object, Object, Vars)
0882      * @see jsx.core.ArrayLikes#slice(ArrayLike, Object)
0883      * @since 1.0
0884      * @javascript Re-compilers must convert the instance invocation of this method directly 
0885      * into a JavaScript invocation on its current array instance without changing the 
0886      * method name, but expanding variable arguments, if any, into comma-separated values. 
0887      */
0888     public final JsArray slice(Object start) {
0889         return new JsArray(call(slice, start));
0890     }
0891     /**
0892      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
0893      * it. The returned array contains the element positioned by <tt>start</tt> and 
0894      * all subsequent elements up to, but not including, the element positioned by 
0895      * <tt>end</tt>. If <tt>end</tt> is an undefined value, the returned array 
0896      * contains all elements from the <tt>start</tt> to the end of the current array.</p>
0897      * @param start The array index at which the slice is to begin. If negative, this 
0898      * argument specifies a position measured from the end of the current array. That is, 
0899      * -1 indicates the last element, -2 indicates the next from the last element, and so on.
0900      * @param end The array index immediately after the end of the slice. If undefined, 
0901      * the slice includes all array elements from the <tt>start</tt> to the end 
0902      * of the array. If this argument is negative, it specifies an array element measured 
0903      * from the end of the array.
0904      * @return A new array that contains the elements of current array instance from the 
0905      * element positioned by <tt>start</tt>, up to, but not including, the element 
0906      * positioned by <tt>end</tt>.
0907      * @see #slice(Object)
0908      * @see #slice(Vars)
0909      * @see #splice(Object)
0910      * @see #splice(Vars)
0911      * @see #splice(Object, Object)
0912      * @see #splice(Object, Object, Object)
0913      * @see #splice(Object, Object, Vars)
0914      * @see jsx.core.ArrayLikes#slice(ArrayLike, Object, Object)
0915      * @since 1.0
0916      * @javascript Re-compilers must convert the instance invocation of this method directly 
0917      * into a JavaScript invocation on its current array instance without changing the 
0918      * method name, but expanding variable arguments, if any, into comma-separated values. 
0919      */
0920     public final JsArray slice(Object start, Object end) {
0921         return new JsArray(call(slice, new Vars<Object>().add(start).add(end)));
0922     }
0923     /**
0924      * <p>Sorts the elements of the current array instance in place by arranging them in 
0925      * alphabetical order (more precisely, the order determined by the character encoding).
0926      * To do this, elements are first converted to strings, if necessary, so that they can 
0927      * be compared. Note that the array is sorted in place, and no copy is made.
0928      * And undefined elements are always sorted to the end of the array.</p>
0929      * @return A reference to the current array.
0930      * @see #sort(JsFunction)
0931      * @see jsx.core.ArrayLikes#sort(ArrayLike)
0932      * @since 1.0
0933      * @javascript Re-compilers must convert the instance invocation of this method directly 
0934      * into a JavaScript invocation on its current array instance without changing the 
0935      * method name, but expanding variable arguments, if any, into comma-separated values. 
0936      */
0937     public final JsArray sort() {
0938         return new JsArray(call(sort));
0939     }
0940     /**
0941      * <p>Sorts the elements of the current array instance with the custom ordering function 
0942      * <tt>orderfunc</tt>. Note that the array is sorted in place, and no copy is made.
0943      * And undefined elements are always sorted to the end of the array because undefined 
0944      * values are never passed to the ordering function you supply.</p>
0945      * @param orderfunc A comparison function that compares two values and returns a 
0946      * number indicating their relative order. This function should take two arguments, 
0947      * <tt>a</tt> and <tt>b</tt> for instance, and should return one of the following:
0948      * <ul>
0949      * <li>A value less than zero, if, according to your sort criteria, <tt>a</tt> is 
0950      * less than <tt>b</tt> and should appear before <tt>b</tt> in the sorted 
0951      * array.</li>
0952      * <li>Zero, if <tt>a</tt> and <tt>b</tt> are equivalent for the purposes of 
0953      * this sort.</li>
0954      * <li>A value greater than zero, if <tt>a</tt> is greater than <tt>b</tt> 
0955      * for the purposes of the sort.</li>
0956      * </ul>
0957      * @return A reference to the current array.
0958      * @see #sort()
0959      * @see jsx.core.ArrayLikes#sort(ArrayLike, JsFunction)
0960      * @since 1.0
0961      * @javascript Re-compilers must convert the instance invocation of this method directly 
0962      * into a JavaScript invocation on its current array instance without changing the 
0963      * method name, but expanding variable arguments, if any, into comma-separated values. 
0964      */
0965     public final JsArray sort(JsFunction<? extends Number> orderfunc) {
0966         return new JsArray(call(sort, orderfunc));
0967     }
0968     /**
0969      * <p>Deletes elements, numbered by the second value of <tt>args</tt>, starting with and 
0970      * including the element positioned by the first value of <tt>args</tt>, and replaces 
0971      * them with the values listed by <tt>args</tt> from the third value. Array elements 
0972      * that appear after the insertion or deletion are moved as necessary so that they 
0973      * remain contiguous with the rest of the array.</p> 
0974      * <p>Note that, this invocation modifies the current array directly.</p>
0975      * @param args A list of the argument values. The first value specifies the array 
0976      * index at which the deletion and insertion is to begin. The second value specifies 
0977      * the number of elements, starting with and including the element positioned by the 
0978      * first value, to be deleted from the current array. If the second value is undefined, 
0979      * this invocation deletes all elements from the position specified by the first value 
0980      * to the end of the array. The rest of the list provides the values to be inserted 
0981      * into the current array, beginning at the position specified by the first value.
0982      * @return An array containing the elements, if any, deleted from the current array.
0983      * @see #slice(Vars)
0984      * @see #slice(Object)
0985      * @see #slice(Object, Object)
0986      * @see #splice(Object)
0987      * @see #splice(Object, Object)
0988      * @see #splice(Object, Object, Object)
0989      * @see #splice(Object, Object, Vars)
0990      * @since 1.0
0991      * @javascript Re-compilers must convert the instance invocation of this method directly 
0992      * into a JavaScript invocation on its current array instance without changing the 
0993      * method name, but expanding variable arguments, if any, into comma-separated values. 
0994      */
0995     public final JsArray splice(Vars<?> args) {
0996         return new JsArray(call(splice, args));
0997     }
0998     /**
0999      * <p>Deletes zero or more array elements starting with and including the element 
1000      * positioned by <tt>start</tt>.</p>
1001      * <p>Note that, this invocation modifies the current array directly.</p>
1002      * @param start The array index at which the insertion and/or deletion is to begin.
1003      * @return An array containing the elements, if any, deleted from the current array.
1004      * @see #slice(Vars)
1005      * @see #slice(Object)
1006      * @see #slice(Object, Object)
1007      * @see #splice(Vars)
1008      * @see #splice(Object, Object)
1009      * @see #splice(Object, Object, Object)
1010      * @see #splice(Object, Object, Vars)
1011      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object)
1012      * @since 1.0
1013      * @javascript Re-compilers must convert the instance invocation of this method directly 
1014      * into a JavaScript invocation on its current array instance without changing the 
1015      * method name, but expanding variable arguments, if any, into comma-separated values. 
1016      */
1017     public final JsArray splice(Object start) {
1018         return new JsArray(call(splice, start));
1019     }
1020     /**
1021      * <p>Deletes <tt>deleteCount</tt> elements of the current array instance starting 
1022      * with and including the element positioned by <tt>start</tt>. Array elements 
1023      * that appear after deletion are moved as necessary so that they remain contiguous 
1024      * with the rest of the array.</p> 
1025      * <p>Note that, this invocation modifies the current array directly.</p>
1026      * @param start The array index at which the deletion is to begin.
1027      * @param deleteCount The number of elements, starting with and including the element 
1028      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
1029      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
1030      * of the array.
1031      * @return An array containing the elements, if any, deleted from the current array.
1032      * @see #slice(Vars)
1033      * @see #slice(Object)
1034      * @see #slice(Object, Object)
1035      * @see #splice(Object)
1036      * @see #splice(Vars)
1037      * @see #splice(Object, Object, Object)
1038      * @see #splice(Object, Object, Vars)
1039      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object, Object)
1040      * @since 1.0
1041      * @javascript Re-compilers must convert the instance invocation of this method directly 
1042      * into a JavaScript invocation on its current array instance without changing the 
1043      * method name, but expanding variable arguments, if any, into comma-separated values. 
1044      */
1045     public final JsArray splice(Object start, Object deleteCount) {
1046         return new JsArray(call(splice, new Vars<Object>().add(start).add(deleteCount)));
1047     }
1048     /**
1049      * <p>Deletes <tt>deleteCount</tt> elements starting with and including the 
1050      * element positioned by <tt>start</tt> and replaces them with the argument 
1051      * <tt>value</tt>. Array elements that appear after the insertion or deletion are 
1052      * moved as necessary so that they remain contiguous with the rest of the array.</p> 
1053      * <p>Note that, this invocation modifies the current array directly.</p>
1054      * @param start The array index at which the deletion and insertion is to begin.
1055      * @param deleteCount The number of elements, starting with and including the element 
1056      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
1057      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
1058      * of the array.
1059      * @param value The value to be inserted into the current array, beginning at the index 
1060      * specified by <tt>start</tt>.
1061      * @return An array containing the elements, if any, deleted from the current array.
1062      * @see #slice(Vars)
1063      * @see #slice(Object)
1064      * @see #slice(Object, Object)
1065      * @see #splice(Object)
1066      * @see #splice(Vars)
1067      * @see #splice(Object, Object)
1068      * @see #splice(Object, Object, Vars)
1069      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object, Object, Object)
1070      * @since 1.0
1071      * @javascript Re-compilers must convert the instance invocation of this method directly 
1072      * into a JavaScript invocation on its current array instance without changing the 
1073      * method name, but expanding variable arguments, if any, into comma-separated values. 
1074      */
1075     public final JsArray splice(Object start, Object deleteCount, Object value) {
1076         return new JsArray(call(splice, new Vars<Object>().add(start).add(deleteCount).add(value)));
1077     }
1078     /**
1079      * <p>Deletes <tt>deleteCount</tt> elements starting with and including the 
1080      * element positioned by <tt>start</tt> and replaces them with the values listed by 
1081      * <tt>args</tt>. Array elements that appear after the insertion or deletion are 
1082      * moved as necessary so that they remain contiguous with the rest of the array.</p> 
1083      * <p>Note that, this invocation modifies the current array directly.</p>
1084      * @param start The array index at which the deletion and insertion is to begin.
1085      * @param deleteCount The number of elements, starting with and including the element 
1086      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
1087      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
1088      * of the array.
1089      * @param args A list of the argument values to be inserted into the current array, 
1090      * beginning at the index specified by <tt>start</tt>.
1091      * @return An array containing the elements, if any, deleted from the current array.
1092      * @see #slice(Vars)
1093      * @see #slice(Object)
1094      * @see #slice(Object, Object)
1095      * @see #splice(Object)
1096      * @see #splice(Vars)
1097      * @see #splice(Object, Object)
1098      * @see #splice(Object, Object, Object)
1099      * @since 1.0
1100      * @javascript Re-compilers must convert the instance invocation of this method directly 
1101      * into a JavaScript invocation on its current array instance without changing the 
1102      * method name, but expanding variable arguments, if any, into comma-separated values. 
1103      */
1104     public final JsArray splice(Object start, Object deleteCount, Vars<?> args) {
1105         return new JsArray(call(splice, new Vars<Object>().add(start).add(deleteCount).addAll(args)));
1106     }
1107     /**
1108      * <p>Inserts a list of values at the beginning of the current array instance, 
1109      * shifting the existing elements to higher indexes to make room. The first value of 
1110      * the argument list becomes the new element 0 of the array; the second value, if any, 
1111      * becomes the new element 1; and so on. Note that this invocation does not create a 
1112      * new array; it modifies the current array directly.</p>
1113      * @param args A list of the argument values that are inserted at the start of 
1114      * the current array.
1115      * @return The new length of the current array.
1116      * @see #unshift(Object)
1117      * @see #shift()
1118      * @since 1.0
1119      * @javascript Re-compilers must convert the instance invocation of this method directly 
1120      * into a JavaScript invocation on its current array instance without changing the 
1121      * method name, but expanding variable arguments, if any, into comma-separated values. 
1122      */
1123     public final int unshift(Vars<?> args) {
1124         return call(unshift, args).intValue();
1125     }
1126     /**
1127      * <p>Inserts the argument at the beginning of the current array instance, 
1128      * shifting the existing elements to higher indexes to make room. The argument becomes 
1129      * the new element 0 of the array. Note that this invocation does not create a new 
1130      * array; it modifies the current array directly.</p>
1131      * @param arg A value that is inserted at the start of the current array.
1132      * @return The new length of the current array.
1133      * @see #unshift(Vars)
1134      * @see #shift()
1135      * @see jsx.core.ArrayLikes#unshift(ArrayLike, Object)
1136      * @since 1.0
1137      * @javascript Re-compilers must convert the instance invocation of this method directly 
1138      * into a JavaScript invocation on its current array instance without changing the 
1139      * method name, but expanding variable arguments, if any, into comma-separated values. 
1140      */
1141     public final int unshift(Object arg) {
1142         return call(unshift, arg).intValue();
1143     }
1144 
1145     /**
1146      * <p>Returns the primitive value associated with the current instance, if there is one. 
1147      * This invocation simply returns the instance itself for the current array instance 
1148      * is an object and there is no primitive value for it.</p>
1149      * @return The current array itself.
1150      * @see #toString()
1151      * @since 1.0
1152      * @javascript Re-compilers must convert the instance invocation of this method directly 
1153      * into a JavaScript invocation on its current array instance without changing the 
1154      * method name, but expanding variable arguments, if any, into comma-separated values. 
1155      */
1156     @Override
1157     public JsArray valueOf() {
1158         return var().valueOf();
1159     }
1160 
1161     /**
1162      * <p>Logically evaluates the current instance.</p>
1163      * @return The logical value of the current instance.
1164      * @since 1.0
1165      * @javascript Re-compilers must ignore the instance invocation of this method, that is, 
1166      * replacing it with its current instance.
1167      */
1168     public final boolean be() {
1169         return Js.be(var());
1170     }
1171 
1172     /**
1173      * <p>Inverts the boolean value of the current instance, resembling the 
1174      * logical NOT operator in JavaScript.</p>
1175      * <p>This operation converts the current instance to a boolean value using 
1176      * the following rules if necessary before inverting the converted value.</p>
1177      * <ul>
1178      * <li>If a number is used where a boolean value is expected, the number is converted 
1179      * to <tt>true</tt> unless the number is 0 or NaN, which are converted to <tt>false</tt>.</li>
1180      * <li>If a string is used where a boolean value is expected, it is converted to <tt>true</tt> 
1181      * except for the empty string, which is converted to <tt>false</tt>.</li>
1182      * <li><tt>null</tt> and the undefined value convert to <tt>false</tt>, and any 
1183      * non-null object, array, or function converts to <tt>true</tt>.
1184      * </ul>
1185      * <p>You can convert any value <tt>x</tt> to its equivalent boolean value by applying 
1186      * this operation twice: <tt>Js.not(Js.not(x))</tt></p>
1187      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1188      * re-compilations. However, in most cases you can use the logical NOT operator of the 
1189      * Java language like this:
1190      * <pre>!Js.be(var)</pre>
1191      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1192      * JavaScript expression since the Java compilers generally used are free to compile 
1193      * the expression into any byte codes they think efficient, making it too hard for the 
1194      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1195      * @return The inverted boolean value.
1196      * @since 1.0
1197      * @javascript Re-compilers must replace the instance invocation of this method with the 
1198      * JavaScript expression:
1199      * <pre>!a</pre>
1200      * where <tt>a</tt> is the current array instance of the invocation of this method.
1201      */
1202     public final boolean not() {
1203         return Js.not(this);
1204     }
1205 
1206     /**
1207      * <p>Checks if the current array instance is an instance of the second operand, 
1208      * resembling the <tt>instanceof</tt> operator in JavaScript.</p>
1209      * <p>This operation expects the first operand be an object and the second be a class 
1210      * of objects. In JavaScript, classes of objects are defined by the constructor function 
1211      * that initializes them.</p>
1212      * @param other A constructor function.
1213      * @return <tt>true</tt> if the current primitive instance is an instance of the second 
1214      * operand; <tt>false</tt>, otherwise;
1215      * @since 1.0
1216      * @javascript Re-compilers must replace the instance invocation of this method with the 
1217      * JavaScript expression:
1218      * <pre>a instanceof other</pre>
1219      * where <tt>a</tt> is the current array instance of the invocation of this method.
1220      */
1221     public final boolean instanceOf(Object other) {
1222         return Js.instanceOf(this, other);
1223     }
1224 
1225     /**
1226      * <p>Checks whether the two operands are "equal" using a more relaxed definition of 
1227      * sameness that allows type conversions, resembling the equality operator in 
1228      * JavaScript.</p>
1229      * <p>The equality and identity operations check whether two values are the same, using 
1230      * two different definitions of sameness. Both operations accept operands of any type, 
1231      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1232      * if they are different. The identity operation checks whether its two operands are 
1233      * "identical" using a strict definition of sameness. The equality operation checks 
1234      * whether its two operands are "equal" using a more relaxed definition of sameness 
1235      * that allows type conversions.</p>
1236      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1237      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1238      * assignment, equality, and identity operations, and be careful to use the correct one 
1239      * when coding! Although it is tempting to call all three operations "equals," it may 
1240      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1241      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1242      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1243      * case, two separate values are involved, and the equality and identity operations 
1244      * check that these two values are identical. This means that two variables are equal 
1245      * or identical only if they contain the same value. For example, two strings are equal 
1246      * only if they each contain exactly the same characters.</p>
1247      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1248      * means that two variables are equal only if they refer to the same object. Two 
1249      * separate arrays are never equal or identical, even if they contain equal or identical 
1250      * elements. Two variables that contain references to objects, arrays, or functions are 
1251      * equal only if they refer to the same object, array, or function. If you want to test 
1252      * that two distinct objects contain the same properties or that two distinct arrays 
1253      * contain the same elements, you'll have to check the properties or elements individually 
1254      * for equality or identity. And, if any of the properties or elements are themselves 
1255      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1256      * <p>The following rules determine whether two values are equal according to the 
1257      * equality operation:
1258      * <ul>
1259      * <li>If the two values have the same type, test them for identity. If the values are 
1260      * identical, they are equal; if they are not identical, they are not equal.</li>
1261      * <li>If the two values do not have the same type, they may still be equal. Use the 
1262      * following rules and type conversions to check for equality:</li>
1263      * <ul>
1264      * <li>If one value is null and the other is undefined, they are equal.</li>
1265      * <li>If one value is a number and the other is a string, convert the string to a 
1266      * number and try the comparison again, using the converted value.</li>
1267      * <li>If either value is <tt>true</tt>, convert it to 1 and try the comparison 
1268      * again. If either value is <tt>false</tt>, convert it to 0 and try the comparison 
1269      * again.</li>
1270      * <li>If one value is an object and the other is a number or string, convert the 
1271      * object to a primitive and try the comparison again. An object is converted to a 
1272      * primitive value by either its <tt>toString()</tt> method or its <tt>valueOf()</tt> 
1273      * method. The built-in classes of core JavaScript attempt <tt>valueOf()</tt> 
1274      * conversion before <tt>toString()</tt> conversion, except for the Date class, 
1275      * which performs <tt>toString()</tt> conversion. Objects that are not part of core 
1276      * JavaScript may convert themselves to primitive values in an implementation-defined 
1277      * way.</li>
1278      * <li>Any other combinations of values are not equal.</li>
1279      * </ul>
1280      * </ul>
1281      * @param other Any value or object.
1282      * @return <tt>true</tt> if the first operand equals the second; <tt>false</tt>, 
1283      * otherwise;
1284      * @since 1.0
1285      * @javascript Re-compilers must replace the instance invocation of this method with the 
1286      * JavaScript expression:
1287      * <pre>a == other</pre>
1288      * where <tt>a</tt> is the current array instance of the invocation of this method.
1289      */
1290     public final boolean eq(Object other) {
1291         return Js.eq(var(), other);
1292     }
1293 
1294     /**
1295      * <p>Checks whether the two operands are "identical" using a strict definition of 
1296      * sameness, resembling the identity operator in JavaScript.</p>
1297      * <p>The equality and identity operations check whether two values are the same, using 
1298      * two different definitions of sameness. Both operations accept operands of any type, 
1299      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1300      * if they are different. The identity operation checks whether its two operands are 
1301      * "identical" using a strict definition of sameness. The equality operation checks 
1302      * whether its two operands are "equal" using a more relaxed definition of sameness 
1303      * that allows type conversions.</p>
1304      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1305      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1306      * assignment, equality, and identity operations, and be careful to use the correct one 
1307      * when coding! Although it is tempting to call all three operations "equals," it may 
1308      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1309      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1310      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1311      * case, two separate values are involved, and the equality and identity operations 
1312      * check that these two values are identical. This means that two variables are equal 
1313      * or identical only if they contain the same value. For example, two strings are equal 
1314      * only if they each contain exactly the same characters.</p>
1315      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1316      * means that two variables are equal only if they refer to the same object. Two 
1317      * separate arrays are never equal or identical, even if they contain equal or identical 
1318      * elements. Two variables that contain references to objects, arrays, or functions are 
1319      * equal only if they refer to the same object, array, or function. If you want to test 
1320      * that two distinct objects contain the same properties or that two distinct arrays 
1321      * contain the same elements, you'll have to check the properties or elements individually 
1322      * for equality or identity. And, if any of the properties or elements are themselves 
1323      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1324      * <p>The following rules determine whether two values are identical according to the identity operation:
1325      * <ul>
1326      * <li>If the two values have different types, they are not identical.</li>
1327      * <li>If both values are numbers and have the same value, they are identical, unless 
1328      * either or both values are <tt>NaN</tt>, in which case they are not identical. 
1329      * The <tt>NaN</tt> value is never identical to any other value, including itself! 
1330      * To check whether a value is <tt>NaN</tt>, use the global {@link Js#isNaN(Object)} 
1331      * function.</li>
1332      * <li>If both values are strings and contain exactly the same characters in the same 
1333      * positions, they are identical. If the strings differ in length or content, they are 
1334      * not identical. Note that in some cases, the Unicode standard allows more than one 
1335      * way to encode the same string. For efficiency, however, JavaScript's string 
1336      * comparison compares strictly on a character-by-character basis, and it assumes that 
1337      * all strings have been converted to a "normalized form" before they are compared. 
1338      * See the {@link StringLike#localeCompare(Object)} for another way to compare strings.</li>
1339      * <li>If both values are the boolean value <tt>true</tt> or both are the boolean 
1340      * value <tt>false</tt>, they are identical.</li>
1341      * <li>If both values refer to the same object, array, or function, they are identical. 
1342      * If they refer to different objects (or arrays or functions) they are not identical, 
1343      * even if both objects have identical properties or both arrays have identical elements.</li>
1344      * <li>If both values are null or both values are undefined, they are identical.</li>
1345      * </ul>
1346      * @param other Any value or object.
1347      * @return <tt>true</tt> if the first operand is identical to the second; 
1348      * <tt>false</tt>, otherwise;
1349      * @since 1.0
1350      * @javascript Re-compilers must replace the instance invocation of this method with the 
1351      * JavaScript expression:
1352      * <pre>a === other</pre>
1353      * where <tt>a</tt> is the current array instance of the invocation of this method.
1354      */
1355     public final boolean eqs(Object other) {
1356         return Js.eqs(this, other);
1357     }
1358 
1359     /**
1360      * <p>Checks whether the two operands are not "equal" using a more relaxed definition of 
1361      * sameness that allows type conversions, resembling the equality operator in 
1362      * JavaScript.</p>
1363      * <p>The equality and identity operations check whether two values are the same, using 
1364      * two different definitions of sameness. Both operations accept operands of any type, 
1365      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1366      * if they are different. The identity operation checks whether its two operands are 
1367      * "identical" using a strict definition of sameness. The equality operation checks 
1368      * whether its two operands are "equal" using a more relaxed definition of sameness 
1369      * that allows type conversions.</p>
1370      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1371      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1372      * assignment, equality, and identity operations, and be careful to use the correct one 
1373      * when coding! Although it is tempting to call all three operations "equals," it may 
1374      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1375      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1376      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1377      * case, two separate values are involved, and the equality and identity operations 
1378      * check that these two values are identical. This means that two variables are equal 
1379      * or identical only if they contain the same value. For example, two strings are equal 
1380      * only if they each contain exactly the same characters.</p>
1381      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1382      * means that two variables are equal only if they refer to the same object. Two 
1383      * separate arrays are never equal or identical, even if they contain equal or identical 
1384      * elements. Two variables that contain references to objects, arrays, or functions are 
1385      * equal only if they refer to the same object, array, or function. If you want to test 
1386      * that two distinct objects contain the same properties or that two distinct arrays 
1387      * contain the same elements, you'll have to check the properties or elements individually 
1388      * for equality or identity. And, if any of the properties or elements are themselves 
1389      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1390      * <p>The following rules determine whether two values are equal according to the 
1391      * equality operation:
1392      * <ul>
1393      * <li>If the two values have the same type, test them for identity. If the values are 
1394      * identical, they are equal; if they are not identical, they are not equal.</li>
1395      * <li>If the two values do not have the same type, they may still be equal. Use the 
1396      * following rules and type conversions to check for equality:</li>
1397      * <ul>
1398      * <li>If one value is null and the other is undefined, they are equal.</li>
1399      * <li>If one value is a number and the other is a string, convert the string to a 
1400      * number and try the comparison again, using the converted value.</li>
1401      * <li>If either value is <tt>true</tt>, convert it to 1 and try the comparison 
1402      * again. If either value is <tt>false</tt>, convert it to 0 and try the comparison 
1403      * again.</li>
1404      * <li>If one value is an object and the other is a number or string, convert the 
1405      * object to a primitive and try the comparison again. An object is converted to a 
1406      * primitive value by either its <tt>toString()</tt> method or its <tt>valueOf()</tt> 
1407      * method. The built-in classes of core JavaScript attempt <tt>valueOf()</tt> 
1408      * conversion before <tt>toString()</tt> conversion, except for the Date class, 
1409      * which performs <tt>toString()</tt> conversion. Objects that are not part of core 
1410      * JavaScript may convert themselves to primitive values in an implementation-defined 
1411      * way.</li>
1412      * <li>Any other combinations of values are not equal.</li>
1413      * </ul>
1414      * </ul>
1415      * @param other Any value or object.
1416      * @return <tt>false</tt> if the first operand equals the second; <tt>true</tt>, 
1417      * otherwise;
1418      * @since 1.0
1419      * @javascript Re-compilers must replace the instance invocation of this method with the 
1420      * JavaScript expression:
1421      * <pre>a != other</pre>
1422      * where <tt>a</tt> is the current array instance of the invocation of this method.
1423      */
1424     public final boolean neq(Object other) {
1425         return Js.neq(var(), other);
1426     }
1427 
1428     /**
1429      * <p>Checks whether the two operands are not "identical" using a strict definition of 
1430      * sameness, resembling the identity operator in JavaScript.</p>
1431      * <p>The equality and identity operations check whether two values are the same, using 
1432      * two different definitions of sameness. Both operations accept operands of any type, 
1433      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1434      * if they are different. The identity operation checks whether its two operands are 
1435      * "identical" using a strict definition of sameness. The equality operation checks 
1436      * whether its two operands are "equal" using a more relaxed definition of sameness 
1437      * that allows type conversions.</p>
1438      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1439      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1440      * assignment, equality, and identity operations, and be careful to use the correct one 
1441      * when coding! Although it is tempting to call all three operations "equals," it may 
1442      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1443      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1444      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1445      * case, two separate values are involved, and the equality and identity operations 
1446      * check that these two values are identical. This means that two variables are equal 
1447      * or identical only if they contain the same value. For example, two strings are equal 
1448      * only if they each contain exactly the same characters.</p>
1449      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1450      * means that two variables are equal only if they refer to the same object. Two 
1451      * separate arrays are never equal or identical, even if they contain equal or identical 
1452      * elements. Two variables that contain references to objects, arrays, or functions are 
1453      * equal only if they refer to the same object, array, or function. If you want to test 
1454      * that two distinct objects contain the same properties or that two distinct arrays 
1455      * contain the same elements, you'll have to check the properties or elements individually 
1456      * for equality or identity. And, if any of the properties or elements are themselves 
1457      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1458      * <p>The following rules determine whether two values are identical according to the identity operation:
1459      * <ul>
1460      * <li>If the two values have different types, they are not identical.</li>
1461      * <li>If both values are numbers and have the same value, they are identical, unless 
1462      * either or both values are <tt>NaN</tt>, in which case they are not identical. 
1463      * The <tt>NaN</tt> value is never identical to any other value, including itself! 
1464      * To check whether a value is <tt>NaN</tt>, use the global {@link Js#isNaN(Object)} 
1465      * function.</li>
1466      * <li>If both values are strings and contain exactly the same characters in the same 
1467      * positions, they are identical. If the strings differ in length or content, they are 
1468      * not identical. Note that in some cases, the Unicode standard allows more than one 
1469      * way to encode the same string. For efficiency, however, JavaScript's string 
1470      * comparison compares strictly on a character-by-character basis, and it assumes that 
1471      * all strings have been converted to a "normalized form" before they are compared. 
1472      * See the {@link StringLike#localeCompare(Object)} for another way to compare strings.</li>
1473      * <li>If both values are the boolean value <tt>true</tt> or both are the boolean 
1474      * value <tt>false</tt>, they are identical.</li>
1475      * <li>If both values refer to the same object, array, or function, they are identical. 
1476      * If they refer to different objects (or arrays or functions) they are not identical, 
1477      * even if both objects have identical properties or both arrays have identical elements.</li>
1478      * <li>If both values are null or both values are undefined, they are identical.</li>
1479      * </ul>
1480      * @param other Any value or object.
1481      * @return <tt>false</tt> if the first operand is identical to the second; 
1482      * <tt>true</tt>, otherwise;
1483      * @since 1.0
1484      * @javascript Re-compilers must replace the instance invocation of this method with the 
1485      * JavaScript expression:
1486      * <pre>a !== other</pre>
1487      * where <tt>a</tt> is the current array instance of the invocation of this method.
1488      */
1489     public final boolean neqs(Object other) {
1490         return Js.neqs(this, other);
1491     }
1492 
1493     /**
1494      * <p>Adds the current instance to a numeric operand or concatenates it with 
1495      * a string operand, resembling the addition operator in JavaScript.</p>
1496      * <p>If one value is a string, the other is converted to a string, and the two 
1497      * strings are then concatenated. Object operands are converted to numbers or strings 
1498      * that can be added or concatenated. The conversion is performed by {@link Js#valueOf(Object)}  
1499      * method and/or the {@link Js#toString(Object)} method on the object.</p>
1500      * @param other A value or object.
1501      * @return The sum or concatenation of the values.
1502      * @since 1.0
1503      * @javascript Re-compilers must replace the instance invocation of this method with the 
1504      * JavaScript expression:
1505      * <pre>a + other</pre>
1506      * where <tt>a</tt> is the current instance of the invocation of this method.
1507      */
1508     public final String add(Object other) {
1509         return Js.add(toString(), other);
1510     }
1511 
1512     /**
1513      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
1514      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
1515      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
1516      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
1517      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
1518      * may or may not evaluate the right-side expression. The actual behavior of the operator 
1519      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
1520      * on its left. If the value of this expression can be converted to <tt>false</tt> 
1521      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
1522      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
1523      * its second operand, the expression on its right, and returns the value of that 
1524      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
1525      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
1526      * returning the unconverted value of the left-side expression.</p>
1527      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1528      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1529      * anonymously, returning the actual expression in the method overriding 
1530      * {@link Var#var()}.</p>
1531      * <p>Sometimes, this operation probably does not do what the programmers intended. 
1532      * To avoid problems, do not use expressions with side effects (assignments, increments, 
1533      * decrements, and function calls) for the second operand unless you are quite sure 
1534      * you know exactly what you are doing.</p>
1535      * <p>Despite the fairly confusing way that this operation actually works, it is 
1536      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
1537      * Although it does not actually return a boolean value, the value it returns can always 
1538      * be converted to a boolean value.</p>
1539      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1540      * re-compilations. However, in most cases you can use the logical AND operator of the 
1541      * Java language like this:
1542      * <pre>Js.be(var) && Js.be(other)</pre>
1543      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1544      * JavaScript expression since the Java compilers generally used are free to compile 
1545      * the expression into any byte codes they think efficient, making it too hard for the 
1546      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1547      * @param other A value or object.
1548      * @return The logical AND of the two operands.
1549      * @since 1.0
1550      * @javascript Re-compilers must replace the instance invocation of this method with the 
1551      * JavaScript expression:
1552      * <pre>a && other</pre>
1553      * where <tt>a</tt> is the current instance of the invocation of this method.
1554      */
1555     public final Object and(Object other) {
1556         return Js.and(this, other);
1557     }
1558 
1559     /**
1560      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
1561      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
1562      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
1563      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
1564      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
1565      * may or may not evaluate the right-side expression. The actual behavior of the operator 
1566      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
1567      * on its left. If the value of this expression can be converted to <tt>false</tt> 
1568      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
1569      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
1570      * its second operand, the expression on its right, and returns the value of that 
1571      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
1572      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
1573      * returning the unconverted value of the left-side expression.</p>
1574      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1575      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1576      * anonymously, returning the actual expression in the method overriding 
1577      * {@link Var#var()}.</p>
1578      * <p>Sometimes, this operation probably does not do what the programmers intended. 
1579      * To avoid problems, do not use expressions with side effects (assignments, increments, 
1580      * decrements, and function calls) for the second operand unless you are quite sure 
1581      * you know exactly what you are doing.</p>
1582      * <p>Despite the fairly confusing way that this operation actually works, it is 
1583      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
1584      * Although it does not actually return a boolean value, the value it returns can always 
1585      * be converted to a boolean value.</p>
1586      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1587      * re-compilations. However, in most cases you can use the logical AND operator of the 
1588      * Java language like this:
1589      * <pre>Js.be(var) && Js.be(other)</pre>
1590      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1591      * JavaScript expression since the Java compilers generally used are free to compile 
1592      * the expression into any byte codes they think efficient, making it too hard for the 
1593      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1594      * @param other A value or object.
1595      * @return The logical AND of the two operands.
1596      * @since 1.0
1597      * @javascript Re-compilers must replace the instance invocation of this method with the 
1598      * JavaScript expression:
1599      * <pre>a && other</pre>
1600      * where <tt>a</tt> is the current instance of the invocation of this method.
1601      */
1602     public final JsObject and(Var<? extends JsObject> other) {
1603         return Js.and(this, other);
1604     }
1605 
1606     /**
1607      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
1608      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
1609      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
1610      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
1611      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
1612      * may or may not evaluate the right-side expression. The actual behavior of the operator 
1613      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
1614      * on its left. If the value of this expression can be converted to <tt>false</tt> 
1615      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
1616      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
1617      * its second operand, the expression on its right, and returns the value of that 
1618      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
1619      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
1620      * returning the unconverted value of the left-side expression.</p>
1621      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1622      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1623      * anonymously, returning the actual expression in the method overriding 
1624      * {@link Var#var()}.</p>
1625      * <p>Sometimes, this operation probably does not do what the programmers intended. 
1626      * To avoid problems, do not use expressions with side effects (assignments, increments, 
1627      * decrements, and function calls) for the second operand unless you are quite sure 
1628      * you know exactly what you are doing.</p>
1629      * <p>Despite the fairly confusing way that this operation actually works, it is 
1630      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
1631      * Although it does not actually return a boolean value, the value it returns can always 
1632      * be converted to a boolean value.</p>
1633      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1634      * re-compilations. However, in most cases you can use the logical AND operator of the 
1635      * Java language like this:
1636      * <pre>Js.be(var) && Js.be(other)</pre>
1637      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1638      * JavaScript expression since the Java compilers generally used are free to compile 
1639      * the expression into any byte codes they think efficient, making it too hard for the 
1640      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1641      * @param other A value or object.
1642      * @return The logical AND of the two operands.
1643      * @since 1.0
1644      * @javascript Re-compilers must replace the instance invocation of this method with the 
1645      * JavaScript expression:
1646      * <pre>a && other</pre>
1647      * where <tt>a</tt> is the current instance of the invocation of this method.
1648      */
1649     public final JsArray and(JsArray other) {
1650         return Js.and(this, other);
1651     }
1652 
1653     /**
1654      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
1655      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
1656      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
1657      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
1658      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
1659      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
1660      * its first operand, the expression on its left. If the value of this expression can 
1661      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
1662      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
1663      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
1664      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
1665      * and doesn't return the unconverted value of the left-side expression.</p>
1666      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1667      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1668      * anonymously, returning the actual expression in the method overriding 
1669      * {@link Var#var()}.</p>
1670      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
1671      * operands that include side effects, unless you purposely want to use the fact that 
1672      * the right-side expression may not be evaluated in JavaScript.</p>
1673      * <p>Even when this operation is used with operands that are not boolean values, it 
1674      * can still be considered a Boolean OR operator because its return value, whatever the 
1675      * type, can be converted to a boolean value.</p>
1676      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1677      * re-compilations. However, in most cases you can use the logical OR operator of the 
1678      * Java language like this:
1679      * <pre>Js.be(var) || Js.be(other)</pre>
1680      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1681      * JavaScript expression since the Java compilers generally used are free to compile 
1682      * the expression into any byte codes they think efficient, making it too hard for the 
1683      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1684      * @param other A value or object.
1685      * @return The logical OR of the two operands.
1686      * @since 1.0
1687      * @javascript Re-compilers must replace the instance invocation of this method with the 
1688      * JavaScript expression:
1689      * <pre>a || other</pre>
1690      * where <tt>a</tt> is the current instance of the invocation of this method.
1691      */
1692     public final Object or(Object other) {
1693         return Js.or(this, other);
1694     }
1695 
1696     /**
1697      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
1698      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
1699      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
1700      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
1701      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
1702      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
1703      * its first operand, the expression on its left. If the value of this expression can 
1704      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
1705      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
1706      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
1707      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
1708      * and doesn't return the unconverted value of the left-side expression.</p>
1709      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1710      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1711      * anonymously, returning the actual expression in the method overriding 
1712      * {@link Var#var()}.</p>
1713      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
1714      * operands that include side effects, unless you purposely want to use the fact that 
1715      * the right-side expression may not be evaluated in JavaScript.</p>
1716      * <p>Even when this operation is used with operands that are not boolean values, it 
1717      * can still be considered a Boolean OR operator because its return value, whatever the 
1718      * type, can be converted to a boolean value.</p>
1719      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1720      * re-compilations. However, in most cases you can use the logical OR operator of the 
1721      * Java language like this:
1722      * <pre>Js.be(var) || Js.be(other)</pre>
1723      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1724      * JavaScript expression since the Java compilers generally used are free to compile 
1725      * the expression into any byte codes they think efficient, making it too hard for the 
1726      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1727      * @param other A value or object.
1728      * @return The logical OR of the two operands.
1729      * @since 1.0
1730      * @javascript Re-compilers must replace the instance invocation of this method with the 
1731      * JavaScript expression:
1732      * <pre>a || other</pre>
1733      * where <tt>a</tt> is the current instance of the invocation of this method.
1734      */
1735     public final JsObject or(Var<? extends JsObject> other) {
1736         return Js.or(this, other);
1737     }
1738 
1739     /**
1740      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
1741      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
1742      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
1743      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
1744      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
1745      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
1746      * its first operand, the expression on its left. If the value of this expression can 
1747      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
1748      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
1749      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
1750      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
1751      * and doesn't return the unconverted value of the left-side expression.</p>
1752      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1753      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1754      * anonymously, returning the actual expression in the method overriding 
1755      * {@link Var#var()}.</p>
1756      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
1757      * operands that include side effects, unless you purposely want to use the fact that 
1758      * the right-side expression may not be evaluated in JavaScript.</p>
1759      * <p>Even when this operation is used with operands that are not boolean values, it 
1760      * can still be considered a Boolean OR operator because its return value, whatever the 
1761      * type, can be converted to a boolean value.</p>
1762      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1763      * re-compilations. However, in most cases you can use the logical OR operator of the 
1764      * Java language like this:
1765      * <pre>Js.be(var) || Js.be(other)</pre>
1766      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1767      * JavaScript expression since the Java compilers generally used are free to compile 
1768      * the expression into any byte codes they think efficient, making it too hard for the 
1769      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1770      * @param other A value or object.
1771      * @return The logical OR of the two operands.
1772      * @since 1.0
1773      * @javascript Re-compilers must replace the instance invocation of this method with the 
1774      * JavaScript expression:
1775      * <pre>a || other</pre>
1776      * where <tt>a</tt> is the current instance of the invocation of this method.
1777      */
1778     public final JsArray or(JsArray other) {
1779         return Js.or(this, other);
1780     }
1781 
1782     /**
1783      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1784      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1785      * operand, otherwise.</p>
1786      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1787      * boolean value. Usually this is the result of a comparison operation. The second and 
1788      * third operands may have any value. The value returned by the conditional operation 
1789      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1790      * the value of the conditional expression is the value of the second operand. If the 
1791      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1792      * value of the third operand.</p>
1793      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1794      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1795      * {@link Var} anonymously, returning the actual expression in the method overriding 
1796      * {@link Var#var()}.</p>
1797      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1798      * re-compilations. However, in most cases you can use the conditional operator of the 
1799      * Java language like this:
1800      * <pre>Js.be(test) ? var : other</pre>
1801      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1802      * JavaScript expression since the Java compilers generally used are free to compile 
1803      * the expression into any byte codes they think efficient, making it too hard for the 
1804      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1805      * @param other A value or object.
1806      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1807      * the third operand.
1808      * @since 1.0
1809      * @javascript Re-compilers must replace the instance invocation of this method with the 
1810      * JavaScript expression:
1811      * <pre>test ? a : other</pre>
1812      * where <tt>a</tt> is the current instance of the invocation of this method.
1813      */
1814     public final Object cond(Object test, Object other) {
1815         return Js.cond(test, this, other);
1816     }
1817 
1818     /**
1819      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1820      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1821      * operand, otherwise.</p>
1822      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1823      * boolean value. Usually this is the result of a comparison operation. The second and 
1824      * third operands may have any value. The value returned by the conditional operation 
1825      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1826      * the value of the conditional expression is the value of the second operand. If the 
1827      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1828      * value of the third operand.</p>
1829      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1830      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1831      * {@link Var} anonymously, returning the actual expression in the method overriding 
1832      * {@link Var#var()}.</p>
1833      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1834      * re-compilations. However, in most cases you can use the conditional operator of the 
1835      * Java language like this:
1836      * <pre>Js.be(test) ? var : other</pre>
1837      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1838      * JavaScript expression since the Java compilers generally used are free to compile 
1839      * the expression into any byte codes they think efficient, making it too hard for the 
1840      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1841      * @param other A value or object.
1842      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1843      * the third operand.
1844      * @since 1.0
1845      * @javascript Re-compilers must replace the instance invocation of this method with the 
1846      * JavaScript expression:
1847      * <pre>test ? a : other</pre>
1848      * where <tt>a</tt> is the current instance of the invocation of this method.
1849      */
1850     public final JsObject cond(Object test, Var<? extends JsObject> other) {
1851         return Js.cond(test, this, other);
1852     }
1853 
1854     /**
1855      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1856      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1857      * operand, otherwise.</p>
1858      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1859      * boolean value. Usually this is the result of a comparison operation. The second and 
1860      * third operands may have any value. The value returned by the conditional operation 
1861      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1862      * the value of the conditional expression is the value of the second operand. If the 
1863      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1864      * value of the third operand.</p>
1865      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1866      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1867      * {@link Var} anonymously, returning the actual expression in the method overriding 
1868      * {@link Var#var()}.</p>
1869      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1870      * re-compilations. However, in most cases you can use the conditional operator of the 
1871      * Java language like this:
1872      * <pre>Js.be(test) ? var : other</pre>
1873      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1874      * JavaScript expression since the Java compilers generally used are free to compile 
1875      * the expression into any byte codes they think efficient, making it too hard for the 
1876      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1877      * @param other A value or object.
1878      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1879      * the third operand.
1880      * @since 1.0
1881      * @javascript Re-compilers must replace the instance invocation of this method with the 
1882      * JavaScript expression:
1883      * <pre>test ? a : other</pre>
1884      * where <tt>a</tt> is the current instance of the invocation of this method.
1885      */
1886     public final JsArray cond(Object test, JsArray other) {
1887         return Js.cond(test, this, other);
1888     }
1889 }