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 boolean 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  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be 
0030  * generated into the target codes. Re-compilers must exit with error on the operations of 
0031  * accessing that kind of class objects.
0032  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored 
0033  * and <tt>instanceof</tt> to it always <tt>true</tt>.
0034  */
0035 public class JsBoolean extends JsGlobal.Boolean.Prototype
0036 {
0037     /**
0038      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
0039      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
0040      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
0041      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
0042      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
0043      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
0044      * either circumstance, the field names must be exactly same as the member names, as 
0045      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
0046      * based on the field names.</p>
0047      *
0048      * @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>
0049      * 
0050      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created 
0051      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
0052      * of class objects.
0053      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in 
0054      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
0055      * <pre>q.m</pre>
0056      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier 
0057      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
0058      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
0059      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
0060      * <pre>m</pre>
0061      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report 
0062      * error on the access to <b>opaque</b> fields declared by this class under any other 
0063      * circumstances.
0064      */
0065     public static class Member extends JsGlobal.Boolean.Prototype.Member
0066     {
0067         /**
0068          * <p>Internally constructs a member based on a qualifying member.</p>
0069          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> 
0070          * or <b>internal</b> classes or class members.</p>
0071          * <p>Note that, this constructor is <b>internal</b> but its declaring class is 
0072          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
0073          * declared in the declaring class of this constructor itself or its subclasses. 
0074          * Under this circumstance, the field names must be exactly same as the member 
0075          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
0076          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly 
0077          * to their names appending to the name resolved from the specified qualifying 
0078          * member with a dot in between.</p>
0079          * @param q A qualifying member
0080          * @param mid The ID of the member to construct
0081          * @since 1.0
0082          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0083          */
0084         public Member(JsObject.Member q, Mid mid) {
0085             super(q, mid);
0086         }
0087         /**
0088          * <p>Internally constructs a member without a qualifying member.</p>
0089          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> 
0090          * or <b>internal</b> classes or class members.</p>
0091          * <p>Note that, this constructor is <b>internal</b> but its declaring class is 
0092          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
0093          * declared in <b>opaque</b> types other than the declaring class of this constructor 
0094          * itself and its subclasses. Under this circumstance, the field names must be 
0095          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b> 
0096          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
0097          * @param mid The ID of the member to construct
0098          * @since 1.0
0099          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0100          */
0101         public Member(Mid mid) {
0102             super(mid);
0103         }
0104         /**
0105          * <p>Evaluates the property, represented by the current member instance, of the 
0106          * argument object.</p>
0107          * @param o The argument object
0108          * @return The value of the current member based on the object argument.
0109          * @since 1.0
0110          * @javascript Re-compilers must convert the instance invocation of this method into 
0111          * the JavaScript expression: 
0112          * <pre>o.m</pre>
0113          * where <tt>m</tt> is the identifier name resolved from the current member 
0114          * instance of the invocation.
0115          */
0116         @Override
0117         public JsBoolean with(ObjectLike o) {
0118             return new JsBoolean((JsObject)var(o).var(mid()));
0119         }
0120 
0121         /**
0122          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the 
0123          * name of this field, qualified by the current member instance of the field, and 
0124          * to access the property of the name on an object.</p>
0125          * <p>The <tt>constructor</tt> property of an object is a reference to the function 
0126          * that was the constructor for that object.</p>
0127          * <p>A common use of the <tt>constructor</tt> property is to determine the type of unknown 
0128          * objects. Given an unknown value, you can use the {@link js.Js#typeof(Object)} operation 
0129          * to determine whether it is a primitive value or an object. If it is an object, you can 
0130          * use the <tt>constructor</tt> property to determine what type of object it is.</p>
0131          * <p>Note, however, that while this technique works for the objects built into core 
0132          * JavaScript, it is not guaranteed to work with host objects such as the <tt>window</tt> 
0133          * object of client-side JavaScript. The default implementation of the <tt>toString()</tt> 
0134          * method provides another way to determine the type of an unknown object.</p>
0135          * @since 1.0
0136          * @javascript Re-compilers must resolve the member of this instance field to the 
0137          * identifier of the field name appending to the identifier resolved from its 
0138          * qualifying member with a dot in between.
0139          */
0140         public final JsFunction.Member<JsBoolean> constructor = new JsFunction.Member<JsBoolean>(this, Members.constructor, Generic.get(JsBoolean.class));
0141     }
0142 
0143     /**
0144      * <p>Internally constructs a boolean object.</p>
0145      * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b> or 
0146      * <b>internal</b> classes or class members.</p>
0147      * <p>Note that, The Java class <tt>java.lang.String</tt> and Java basic classes that 
0148      * wrap primitive data types are also "primitive" to JS.</p>
0149      * @since 1.0
0150      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0151      */
0152     protected JsBoolean(Object var) {
0153         super((JsObject)var);
0154     }
0155     /**
0156      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it 
0157      * with the wrapping constructor.</p>
0158      * @param var The argument of an <b>opaque</b> object.
0159      * @since 1.0
0160      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0161      * that is, replacing it with its only argument.
0162      */
0163     public JsBoolean(JsObject var) {
0164         super(var(var, (JsBoolean)null));
0165     }
0166     /**
0167      * <p>Casts a boolean value to the current <b>opaque</b> type by wrapping it with the 
0168      * wrapping constructor.</p>
0169      * @param var The argument of a boolean.
0170      * @since 1.0
0171      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0172      * that is, replacing it with its only argument.
0173      */
0174     public JsBoolean(Boolean var) {
0175         super(JsGlobal.Boolean.with().create(var));
0176     }
0177     /**
0178      * <p>Casts a boolean value to the current <b>opaque</b> type by wrapping it with the 
0179      * wrapping constructor.</p>
0180      * @param var The argument of a boolean.
0181      * @since 1.0
0182      * @javascript Re-compilers must ignore the construction operation of this constructor, 
0183      * that is, replacing it with its only argument.
0184      */
0185     public JsBoolean(Value<Boolean> var) {
0186         super(JsGlobal.Boolean.with().create(var));
0187     }
0188 
0189     /**
0190      * <p>Simply returns the current boolean instance.</p>
0191      * <p>This method is useful for JS Simulation to implement opaque types.</p>
0192      * @return The current boolean instance.
0193      * @since 1.0
0194      * @javascript Re-compilers must ignore the instance invocation of this method, that is, 
0195      * replacing it with its current instance.
0196      */
0197     @Override
0198     public JsBoolean var() {
0199         return (JsBoolean)super.var();
0200     }
0201     /**
0202      * <p>Assigns the value of another boolean instance to the current boolean object.</p>
0203      * @param var The argument boolean instance.
0204      * @return The new instance.
0205      * @since 1.0
0206      * @javascript Re-compilers must convert the instance invocation of this method into 
0207      * the JavaScript expression: 
0208      * <pre>o = var</pre>
0209      * where <tt>o</tt> is the current instance of the invocation of this method.
0210      */
0211     @Override
0212     public final <S extends JsObject> S var(S var) {
0213         var(var, (JsBoolean)null);
0214         return var;
0215     }
0216 
0217     /**
0218      * <p>An <b>opaque</b> static field defining a member that is named by the field name 
0219      * without a qualifying member and to access the property of the name on an object.</p>
0220      * <p>The <tt>constructor</tt> property of an object is a reference to the function 
0221      * that was the constructor for that object.</p>
0222      * <p>A common use of the <tt>constructor</tt> property is to determine the type of unknown 
0223      * objects. Given an unknown value, you can use the {@link js.Js#typeof(Object)} operation 
0224      * to determine whether it is a primitive value or an object. If it is an object, you can 
0225      * use the <tt>constructor</tt> property to determine what type of object it is.</p>
0226      * <p>Note, however, that while this technique works for the objects built into core 
0227      * JavaScript, it is not guaranteed to work with host objects such as the <tt>window</tt> 
0228      * object of client-side JavaScript. The default implementation of the <tt>toString()</tt> 
0229      * method provides another way to determine the type of an unknown object.</p>
0230      * @since 1.0
0231      * @javascript Re-compilers must resolve the member of this static field to the 
0232      * identifier of the field name.
0233      */
0234     public static final JsFunction.Member<JsBoolean> constructor = new JsFunction.Member<JsBoolean>(Members.constructor, Generic.get(JsBoolean.class));
0235 
0236     /**
0237      * <p>Returns the primitive value associated with the current instance, if there is one.</p>
0238      * @return The value of the current boolean instance.
0239      * @see #toString()
0240      * @since 1.0
0241      * @javascript Re-compilers must convert the instance invocation of this method directly 
0242      * into a JavaScript invocation on its current array instance without changing the 
0243      * method name, but expanding variable arguments, if any, into comma-separated values. 
0244      */
0245     @Override
0246     public Boolean valueOf() {
0247         return var().valueOf();
0248     }
0249 
0250     /**
0251      * <p>Logically evaluates the current instance.</p>
0252      * @return The logical value of the current instance.
0253      * @since 1.0
0254      * @javascript Re-compilers must ignore the instance invocation of this method, that is, 
0255      * replacing it with its current instance.
0256      */
0257     public final boolean be() {
0258         return Js.be(var());
0259     }
0260 
0261     /**
0262      * <p>Inverts the boolean value of the current boolean instance, resembling the 
0263      * logical NOT operator in JavaScript.</p>
0264      * <p>This operation converts the current instance to a boolean value using 
0265      * the following rules if necessary before inverting the converted value.</p>
0266      * <ul>
0267      * <li>If a number is used where a boolean value is expected, the number is converted 
0268      * to <tt>true</tt> unless the number is 0 or NaN, which are converted to <tt>false</tt>.</li>
0269      * <li>If a string is used where a boolean value is expected, it is converted to <tt>true</tt> 
0270      * except for the empty string, which is converted to <tt>false</tt>.</li>
0271      * <li><tt>null</tt> and the undefined value convert to <tt>false</tt>, and any 
0272      * non-null object, array, or function converts to <tt>true</tt>.
0273      * </ul>
0274      * <p>You can convert any value <tt>x</tt> to its equivalent boolean value by applying 
0275      * this operation twice: <tt>Js.not(Js.not(x))</tt></p>
0276      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0277      * re-compilations. However, in most cases you can use the logical NOT operator of the 
0278      * Java language like this:
0279      * <pre>!Js.be(var)</pre>
0280      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0281      * JavaScript expression since the Java compilers generally used are free to compile 
0282      * the expression into any byte codes they think efficient, making it too hard for the 
0283      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0284      * @return The inverted boolean value.
0285      * @since 1.0
0286      * @javascript Re-compilers must replace the instance invocation of this method with the 
0287      * JavaScript expression:
0288      * <pre>!b</pre>
0289      * where <tt>b</tt> is the current boolean instance of the invocation of this method.
0290      */
0291     public final boolean not() {
0292         return Js.not(this);
0293     }
0294 
0295     /**
0296      * <p>Checks if the current boolean instance is an instance of the second operand, 
0297      * resembling the <tt>instanceof</tt> operator in JavaScript.</p>
0298      * <p>This operation expects the first operand be an object and the second be a class 
0299      * of objects. In JavaScript, classes of objects are defined by the constructor function 
0300      * that initializes them.</p>
0301      * @param other A constructor function.
0302      * @return <tt>true</tt> if the current primitive instance is an instance of the second 
0303      * operand; <tt>false</tt>, otherwise;
0304      * @since 1.0
0305      * @javascript Re-compilers must replace the instance invocation of this method with the 
0306      * JavaScript expression:
0307      * <pre>b instanceof other</pre>
0308      * where <tt>b</tt> is the current boolean instance of the invocation of this method.
0309      */
0310     public final boolean instanceOf(Object other) {
0311         return Js.instanceOf(this, other);
0312     }
0313 
0314     /**
0315      * <p>Checks whether the two operands are "equal" using a more relaxed definition of 
0316      * sameness that allows type conversions, resembling the equality operator in 
0317      * JavaScript.</p>
0318      * <p>The equality and identity operations check whether two values are the same, using 
0319      * two different definitions of sameness. Both operations accept operands of any type, 
0320      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
0321      * if they are different. The identity operation checks whether its two operands are 
0322      * "identical" using a strict definition of sameness. The equality operation checks 
0323      * whether its two operands are "equal" using a more relaxed definition of sameness 
0324      * that allows type conversions.</p>
0325      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
0326      * JavaScript 1.3 and later. Be sure you understand the differences between the 
0327      * assignment, equality, and identity operations, and be careful to use the correct one 
0328      * when coding! Although it is tempting to call all three operations "equals," it may 
0329      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
0330      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
0331      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
0332      * case, two separate values are involved, and the equality and identity operations 
0333      * check that these two values are identical. This means that two variables are equal 
0334      * or identical only if they contain the same value. For example, two strings are equal 
0335      * only if they each contain exactly the same characters.</p>
0336      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
0337      * means that two variables are equal only if they refer to the same object. Two 
0338      * separate arrays are never equal or identical, even if they contain equal or identical 
0339      * elements. Two variables that contain references to objects, arrays, or functions are 
0340      * equal only if they refer to the same object, array, or function. If you want to test 
0341      * that two distinct objects contain the same properties or that two distinct arrays 
0342      * contain the same elements, you'll have to check the properties or elements individually 
0343      * for equality or identity. And, if any of the properties or elements are themselves 
0344      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
0345      * <p>The following rules determine whether two values are equal according to the 
0346      * equality operation:
0347      * <ul>
0348      * <li>If the two values have the same type, test them for identity. If the values are 
0349      * identical, they are equal; if they are not identical, they are not equal.</li>
0350      * <li>If the two values do not have the same type, they may still be equal. Use the 
0351      * following rules and type conversions to check for equality:</li>
0352      * <ul>
0353      * <li>If one value is null and the other is undefined, they are equal.</li>
0354      * <li>If one value is a number and the other is a string, convert the string to a 
0355      * number and try the comparison again, using the converted value.</li>
0356      * <li>If either value is <tt>true</tt>, convert it to 1 and try the comparison 
0357      * again. If either value is <tt>false</tt>, convert it to 0 and try the comparison 
0358      * again.</li>
0359      * <li>If one value is an object and the other is a number or string, convert the 
0360      * object to a primitive and try the comparison again. An object is converted to a 
0361      * primitive value by either its <tt>toString()</tt> method or its <tt>valueOf()</tt> 
0362      * method. The built-in classes of core JavaScript attempt <tt>valueOf()</tt> 
0363      * conversion before <tt>toString()</tt> conversion, except for the Date class, 
0364      * which performs <tt>toString()</tt> conversion. Objects that are not part of core 
0365      * JavaScript may convert themselves to primitive values in an implementation-defined 
0366      * way.</li>
0367      * <li>Any other combinations of values are not equal.</li>
0368      * </ul>
0369      * </ul>
0370      * @param other Any value or object.
0371      * @return <tt>true</tt> if the first operand equals the second; <tt>false</tt>, 
0372      * otherwise;
0373      * @since 1.0
0374      * @javascript Re-compilers must replace the instance invocation of this method with the 
0375      * JavaScript expression:
0376      * <pre>b == other</pre>
0377      * where <tt>b</tt> is the current boolean instance of the invocation of this method.
0378      */
0379     public final boolean eq(Object other) {
0380         return Js.eq(var(), other);
0381     }
0382 
0383     /**
0384      * <p>Checks whether the two operands are "identical" using a strict definition of 
0385      * sameness, resembling the identity operator in JavaScript.</p>
0386      * <p>The equality and identity operations check whether two values are the same, using 
0387      * two different definitions of sameness. Both operations accept operands of any type, 
0388      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
0389      * if they are different. The identity operation checks whether its two operands are 
0390      * "identical" using a strict definition of sameness. The equality operation checks 
0391      * whether its two operands are "equal" using a more relaxed definition of sameness 
0392      * that allows type conversions.</p>
0393      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
0394      * JavaScript 1.3 and later. Be sure you understand the differences between the 
0395      * assignment, equality, and identity operations, and be careful to use the correct one 
0396      * when coding! Although it is tempting to call all three operations "equals," it may 
0397      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
0398      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
0399      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
0400      * case, two separate values are involved, and the equality and identity operations 
0401      * check that these two values are identical. This means that two variables are equal 
0402      * or identical only if they contain the same value. For example, two strings are equal 
0403      * only if they each contain exactly the same characters.</p>
0404      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
0405      * means that two variables are equal only if they refer to the same object. Two 
0406      * separate arrays are never equal or identical, even if they contain equal or identical 
0407      * elements. Two variables that contain references to objects, arrays, or functions are 
0408      * equal only if they refer to the same object, array, or function. If you want to test 
0409      * that two distinct objects contain the same properties or that two distinct arrays 
0410      * contain the same elements, you'll have to check the properties or elements individually 
0411      * for equality or identity. And, if any of the properties or elements are themselves 
0412      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
0413      * <p>The following rules determine whether two values are identical according to the identity operation:
0414      * <ul>
0415      * <li>If the two values have different types, they are not identical.</li>
0416      * <li>If both values are numbers and have the same value, they are identical, unless 
0417      * either or both values are <tt>NaN</tt>, in which case they are not identical. 
0418      * The <tt>NaN</tt> value is never identical to any other value, including itself! 
0419      * To check whether a value is <tt>NaN</tt>, use the global {@link Js#isNaN(Object)} 
0420      * function.</li>
0421      * <li>If both values are strings and contain exactly the same characters in the same 
0422      * positions, they are identical. If the strings differ in length or content, they are 
0423      * not identical. Note that in some cases, the Unicode standard allows more than one 
0424      * way to encode the same string. For efficiency, however, JavaScript's string 
0425      * comparison compares strictly on a character-by-character basis, and it assumes that 
0426      * all strings have been converted to a "normalized form" before they are compared. 
0427      * See the {@link StringLike#localeCompare(Object)} for another way to compare strings.</li>
0428      * <li>If both values are the boolean value <tt>true</tt> or both are the boolean 
0429      * value <tt>false</tt>, they are identical.</li>
0430      * <li>If both values refer to the same object, array, or function, they are identical. 
0431      * If they refer to different objects (or arrays or functions) they are not identical, 
0432      * even if both objects have identical properties or both arrays have identical elements.</li>
0433      * <li>If both values are null or both values are undefined, they are identical.</li>
0434      * </ul>
0435      * @param other Any value or object.
0436      * @return <tt>true</tt> if the first operand is identical to the second; 
0437      * <tt>false</tt>, otherwise;
0438      * @since 1.0
0439      * @javascript Re-compilers must replace the instance invocation of this method with the 
0440      * JavaScript expression:
0441      * <pre>b === other</pre>
0442      * where <tt>b</tt> is the current boolean instance of the invocation of this method.
0443      */
0444     public final boolean eqs(Object other) {
0445         return Js.eqs(this, other);
0446     }
0447 
0448     /**
0449      * <p>Checks whether the two operands are not "equal" using a more relaxed definition of 
0450      * sameness that allows type conversions, resembling the equality operator in 
0451      * JavaScript.</p>
0452      * <p>The equality and identity operations check whether two values are the same, using 
0453      * two different definitions of sameness. Both operations accept operands of any type, 
0454      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
0455      * if they are different. The identity operation checks whether its two operands are 
0456      * "identical" using a strict definition of sameness. The equality operation checks 
0457      * whether its two operands are "equal" using a more relaxed definition of sameness 
0458      * that allows type conversions.</p>
0459      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
0460      * JavaScript 1.3 and later. Be sure you understand the differences between the 
0461      * assignment, equality, and identity operations, and be careful to use the correct one 
0462      * when coding! Although it is tempting to call all three operations "equals," it may 
0463      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
0464      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
0465      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
0466      * case, two separate values are involved, and the equality and identity operations 
0467      * check that these two values are identical. This means that two variables are equal 
0468      * or identical only if they contain the same value. For example, two strings are equal 
0469      * only if they each contain exactly the same characters.</p>
0470      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
0471      * means that two variables are equal only if they refer to the same object. Two 
0472      * separate arrays are never equal or identical, even if they contain equal or identical 
0473      * elements. Two variables that contain references to objects, arrays, or functions are 
0474      * equal only if they refer to the same object, array, or function. If you want to test 
0475      * that two distinct objects contain the same properties or that two distinct arrays 
0476      * contain the same elements, you'll have to check the properties or elements individually 
0477      * for equality or identity. And, if any of the properties or elements are themselves 
0478      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
0479      * <p>The following rules determine whether two values are equal according to the 
0480      * equality operation:
0481      * <ul>
0482      * <li>If the two values have the same type, test them for identity. If the values are 
0483      * identical, they are equal; if they are not identical, they are not equal.</li>
0484      * <li>If the two values do not have the same type, they may still be equal. Use the 
0485      * following rules and type conversions to check for equality:</li>
0486      * <ul>
0487      * <li>If one value is null and the other is undefined, they are equal.</li>
0488      * <li>If one value is a number and the other is a string, convert the string to a 
0489      * number and try the comparison again, using the converted value.</li>
0490      * <li>If either value is <tt>true</tt>, convert it to 1 and try the comparison 
0491      * again. If either value is <tt>false</tt>, convert it to 0 and try the comparison 
0492      * again.</li>
0493      * <li>If one value is an object and the other is a number or string, convert the 
0494      * object to a primitive and try the comparison again. An object is converted to a 
0495      * primitive value by either its <tt>toString()</tt> method or its <tt>valueOf()</tt> 
0496      * method. The built-in classes of core JavaScript attempt <tt>valueOf()</tt> 
0497      * conversion before <tt>toString()</tt> conversion, except for the Date class, 
0498      * which performs <tt>toString()</tt> conversion. Objects that are not part of core 
0499      * JavaScript may convert themselves to primitive values in an implementation-defined 
0500      * way.</li>
0501      * <li>Any other combinations of values are not equal.</li>
0502      * </ul>
0503      * </ul>
0504      * @param other Any value or object.
0505      * @return <tt>false</tt> if the first operand equals the second; <tt>true</tt>, 
0506      * otherwise;
0507      * @since 1.0
0508      * @javascript Re-compilers must replace the instance invocation of this method with the 
0509      * JavaScript expression:
0510      * <pre>b != other</pre>
0511      * where <tt>b</tt> is the current boolean instance of the invocation of this method.
0512      */
0513     public final boolean neq(Object other) {
0514         return Js.neq(var(), other);
0515     }
0516 
0517     /**
0518      * <p>Checks whether the two operands are not "identical" using a strict definition of 
0519      * sameness, resembling the identity operator in JavaScript.</p>
0520      * <p>The equality and identity operations check whether two values are the same, using 
0521      * two different definitions of sameness. Both operations accept operands of any type, 
0522      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
0523      * if they are different. The identity operation checks whether its two operands are 
0524      * "identical" using a strict definition of sameness. The equality operation checks 
0525      * whether its two operands are "equal" using a more relaxed definition of sameness 
0526      * that allows type conversions.</p>
0527      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
0528      * JavaScript 1.3 and later. Be sure you understand the differences between the 
0529      * assignment, equality, and identity operations, and be careful to use the correct one 
0530      * when coding! Although it is tempting to call all three operations "equals," it may 
0531      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
0532      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
0533      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
0534      * case, two separate values are involved, and the equality and identity operations 
0535      * check that these two values are identical. This means that two variables are equal 
0536      * or identical only if they contain the same value. For example, two strings are equal 
0537      * only if they each contain exactly the same characters.</p>
0538      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
0539      * means that two variables are equal only if they refer to the same object. Two 
0540      * separate arrays are never equal or identical, even if they contain equal or identical 
0541      * elements. Two variables that contain references to objects, arrays, or functions are 
0542      * equal only if they refer to the same object, array, or function. If you want to test 
0543      * that two distinct objects contain the same properties or that two distinct arrays 
0544      * contain the same elements, you'll have to check the properties or elements individually 
0545      * for equality or identity. And, if any of the properties or elements are themselves 
0546      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
0547      * <p>The following rules determine whether two values are identical according to the identity operation:
0548      * <ul>
0549      * <li>If the two values have different types, they are not identical.</li>
0550      * <li>If both values are numbers and have the same value, they are identical, unless 
0551      * either or both values are <tt>NaN</tt>, in which case they are not identical. 
0552      * The <tt>NaN</tt> value is never identical to any other value, including itself! 
0553      * To check whether a value is <tt>NaN</tt>, use the global {@link Js#isNaN(Object)} 
0554      * function.</li>
0555      * <li>If both values are strings and contain exactly the same characters in the same 
0556      * positions, they are identical. If the strings differ in length or content, they are 
0557      * not identical. Note that in some cases, the Unicode standard allows more than one 
0558      * way to encode the same string. For efficiency, however, JavaScript's string 
0559      * comparison compares strictly on a character-by-character basis, and it assumes that 
0560      * all strings have been converted to a "normalized form" before they are compared. 
0561      * See the {@link StringLike#localeCompare(Object)} for another way to compare strings.</li>
0562      * <li>If both values are the boolean value <tt>true</tt> or both are the boolean 
0563      * value <tt>false</tt>, they are identical.</li>
0564      * <li>If both values refer to the same object, array, or function, they are identical. 
0565      * If they refer to different objects (or arrays or functions) they are not identical, 
0566      * even if both objects have identical properties or both arrays have identical elements.</li>
0567      * <li>If both values are null or both values are undefined, they are identical.</li>
0568      * </ul>
0569      * @param other Any value or object.
0570      * @return <tt>false</tt> if the first operand is identical to the second; 
0571      * <tt>true</tt>, otherwise;
0572      * @since 1.0
0573      * @javascript Re-compilers must replace the instance invocation of this method with the 
0574      * JavaScript expression:
0575      * <pre>a !== other</pre>
0576      * where <tt>a</tt> is the current array instance of the invocation of this method.
0577      */
0578     public final boolean neqs(Object other) {
0579         return Js.neqs(this, other);
0580     }
0581 
0582     /**
0583      * <p>Adds the current instance to a numeric operand or concatenates it with 
0584      * a string operand, resembling the addition operator in JavaScript.</p>
0585      * <p>If one value is a string, the other is converted to a string, and the two 
0586      * strings are then concatenated. Object operands are converted to numbers or strings 
0587      * that can be added or concatenated. The conversion is performed by {@link Js#valueOf(Object)}  
0588      * method and/or the {@link Js#toString(Object)} method on the object.</p>
0589      * @param other A value or object.
0590      * @return The sum or concatenation of the values.
0591      * @since 1.0
0592      * @javascript Re-compilers must replace the instance invocation of this method with the 
0593      * JavaScript expression:
0594      * <pre>a + other</pre>
0595      * where <tt>a</tt> is the current instance of the invocation of this method.
0596      */
0597     public final String add(Object other) {
0598         return Js.add(toString(), other);
0599     }
0600 
0601     /**
0602      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
0603      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
0604      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
0605      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
0606      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
0607      * may or may not evaluate the right-side expression. The actual behavior of the operator 
0608      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
0609      * on its left. If the value of this expression can be converted to <tt>false</tt> 
0610      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
0611      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
0612      * its second operand, the expression on its right, and returns the value of that 
0613      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
0614      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
0615      * returning the unconverted value of the left-side expression.</p>
0616      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0617      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0618      * anonymously, returning the actual expression in the method overriding 
0619      * {@link Var#var()}.</p>
0620      * <p>Sometimes, this operation probably does not do what the programmers intended. 
0621      * To avoid problems, do not use expressions with side effects (assignments, increments, 
0622      * decrements, and function calls) for the second operand unless you are quite sure 
0623      * you know exactly what you are doing.</p>
0624      * <p>Despite the fairly confusing way that this operation actually works, it is 
0625      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
0626      * Although it does not actually return a boolean value, the value it returns can always 
0627      * be converted to a boolean value.</p>
0628      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0629      * re-compilations. However, in most cases you can use the logical AND operator of the 
0630      * Java language like this:
0631      * <pre>Js.be(var) && Js.be(other)</pre>
0632      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0633      * JavaScript expression since the Java compilers generally used are free to compile 
0634      * the expression into any byte codes they think efficient, making it too hard for the 
0635      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0636      * @param other A value or object.
0637      * @return The logical AND of the two operands.
0638      * @since 1.0
0639      * @javascript Re-compilers must replace the instance invocation of this method with the 
0640      * JavaScript expression:
0641      * <pre>a && other</pre>
0642      * where <tt>a</tt> is the current instance of the invocation of this method.
0643      */
0644     public final Object and(Object other) {
0645         return Js.and(this, other);
0646     }
0647 
0648     /**
0649      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
0650      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
0651      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
0652      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
0653      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
0654      * may or may not evaluate the right-side expression. The actual behavior of the operator 
0655      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
0656      * on its left. If the value of this expression can be converted to <tt>false</tt> 
0657      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
0658      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
0659      * its second operand, the expression on its right, and returns the value of that 
0660      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
0661      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
0662      * returning the unconverted value of the left-side expression.</p>
0663      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0664      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0665      * anonymously, returning the actual expression in the method overriding 
0666      * {@link Var#var()}.</p>
0667      * <p>Sometimes, this operation probably does not do what the programmers intended. 
0668      * To avoid problems, do not use expressions with side effects (assignments, increments, 
0669      * decrements, and function calls) for the second operand unless you are quite sure 
0670      * you know exactly what you are doing.</p>
0671      * <p>Despite the fairly confusing way that this operation actually works, it is 
0672      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
0673      * Although it does not actually return a boolean value, the value it returns can always 
0674      * be converted to a boolean value.</p>
0675      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0676      * re-compilations. However, in most cases you can use the logical AND operator of the 
0677      * Java language like this:
0678      * <pre>Js.be(var) && Js.be(other)</pre>
0679      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0680      * JavaScript expression since the Java compilers generally used are free to compile 
0681      * the expression into any byte codes they think efficient, making it too hard for the 
0682      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0683      * @param other A value or object.
0684      * @return The logical AND of the two operands.
0685      * @since 1.0
0686      * @javascript Re-compilers must replace the instance invocation of this method with the 
0687      * JavaScript expression:
0688      * <pre>a && other</pre>
0689      * where <tt>a</tt> is the current instance of the invocation of this method.
0690      */
0691     public final Boolean and(Boolean other) {
0692         return Js.and(this, other);
0693     }
0694 
0695     /**
0696      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
0697      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
0698      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
0699      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
0700      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
0701      * may or may not evaluate the right-side expression. The actual behavior of the operator 
0702      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
0703      * on its left. If the value of this expression can be converted to <tt>false</tt> 
0704      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
0705      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
0706      * its second operand, the expression on its right, and returns the value of that 
0707      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
0708      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
0709      * returning the unconverted value of the left-side expression.</p>
0710      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0711      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0712      * anonymously, returning the actual expression in the method overriding 
0713      * {@link Var#var()}.</p>
0714      * <p>Sometimes, this operation probably does not do what the programmers intended. 
0715      * To avoid problems, do not use expressions with side effects (assignments, increments, 
0716      * decrements, and function calls) for the second operand unless you are quite sure 
0717      * you know exactly what you are doing.</p>
0718      * <p>Despite the fairly confusing way that this operation actually works, it is 
0719      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
0720      * Although it does not actually return a boolean value, the value it returns can always 
0721      * be converted to a boolean value.</p>
0722      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0723      * re-compilations. However, in most cases you can use the logical AND operator of the 
0724      * Java language like this:
0725      * <pre>Js.be(var) && Js.be(other)</pre>
0726      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0727      * JavaScript expression since the Java compilers generally used are free to compile 
0728      * the expression into any byte codes they think efficient, making it too hard for the 
0729      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0730      * @param other A value or object.
0731      * @return The logical AND of the two operands.
0732      * @since 1.0
0733      * @javascript Re-compilers must replace the instance invocation of this method with the 
0734      * JavaScript expression:
0735      * <pre>a && other</pre>
0736      * where <tt>a</tt> is the current instance of the invocation of this method.
0737      */
0738     public final Boolean and(Value<Boolean> other) {
0739         return Js.and(this, other);
0740     }
0741 
0742     /**
0743      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
0744      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
0745      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
0746      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
0747      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
0748      * may or may not evaluate the right-side expression. The actual behavior of the operator 
0749      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
0750      * on its left. If the value of this expression can be converted to <tt>false</tt> 
0751      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
0752      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
0753      * its second operand, the expression on its right, and returns the value of that 
0754      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
0755      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
0756      * returning the unconverted value of the left-side expression.</p>
0757      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0758      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0759      * anonymously, returning the actual expression in the method overriding 
0760      * {@link Var#var()}.</p>
0761      * <p>Sometimes, this operation probably does not do what the programmers intended. 
0762      * To avoid problems, do not use expressions with side effects (assignments, increments, 
0763      * decrements, and function calls) for the second operand unless you are quite sure 
0764      * you know exactly what you are doing.</p>
0765      * <p>Despite the fairly confusing way that this operation actually works, it is 
0766      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
0767      * Although it does not actually return a boolean value, the value it returns can always 
0768      * be converted to a boolean value.</p>
0769      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0770      * re-compilations. However, in most cases you can use the logical AND operator of the 
0771      * Java language like this:
0772      * <pre>Js.be(var) && Js.be(other)</pre>
0773      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0774      * JavaScript expression since the Java compilers generally used are free to compile 
0775      * the expression into any byte codes they think efficient, making it too hard for the 
0776      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0777      * @param other A value or object.
0778      * @return The logical AND of the two operands.
0779      * @since 1.0
0780      * @javascript Re-compilers must replace the instance invocation of this method with the 
0781      * JavaScript expression:
0782      * <pre>a && other</pre>
0783      * where <tt>a</tt> is the current instance of the invocation of this method.
0784      */
0785     public final JsObject and(Var<? extends JsObject> other) {
0786         return Js.and(this, other);
0787     }
0788 
0789     /**
0790      * <p>Logical AND operation, resembling that of JavaScript, performs the Boolean AND 
0791      * operation on the two values: it returns <tt>true</tt> if and only if both its first 
0792      * operand and its second operand are <tt>true</tt>. If one or both of these operands 
0793      * is <tt>false</tt>, it returns <tt>false</tt>.</p>
0794      * <p>In JavaScript, depending on the value of the left-side expression, the operator 
0795      * may or may not evaluate the right-side expression. The actual behavior of the operator 
0796      * is somewhat more complicated. It starts by evaluating its first operand, the expression 
0797      * on its left. If the value of this expression can be converted to <tt>false</tt> 
0798      * (for example, if the left operand evaluates to <tt>null</tt>, 0, "", or undefined), 
0799      * the operator returns the value of the left-side expression. Otherwise, it evaluates 
0800      * its second operand, the expression on its right, and returns the value of that 
0801      * expression. In JavaScript 1.0 and JavaScript 1.1, if the left-side expression 
0802      * evaluates to <tt>false</tt>, the && operator returns <tt>false</tt> rather than 
0803      * returning the unconverted value of the left-side expression.</p>
0804      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0805      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0806      * anonymously, returning the actual expression in the method overriding 
0807      * {@link Var#var()}.</p>
0808      * <p>Sometimes, this operation probably does not do what the programmers intended. 
0809      * To avoid problems, do not use expressions with side effects (assignments, increments, 
0810      * decrements, and function calls) for the second operand unless you are quite sure 
0811      * you know exactly what you are doing.</p>
0812      * <p>Despite the fairly confusing way that this operation actually works, it is 
0813      * easiest, and perfectly safe, to think of it as merely a Boolean algebra operator. 
0814      * Although it does not actually return a boolean value, the value it returns can always 
0815      * be converted to a boolean value.</p>
0816      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0817      * re-compilations. However, in most cases you can use the logical AND operator of the 
0818      * Java language like this:
0819      * <pre>Js.be(var) && Js.be(other)</pre>
0820      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0821      * JavaScript expression since the Java compilers generally used are free to compile 
0822      * the expression into any byte codes they think efficient, making it too hard for the 
0823      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0824      * @param other A value or object.
0825      * @return The logical AND of the two operands.
0826      * @since 1.0
0827      * @javascript Re-compilers must replace the instance invocation of this method with the 
0828      * JavaScript expression:
0829      * <pre>a && other</pre>
0830      * where <tt>a</tt> is the current instance of the invocation of this method.
0831      */
0832     public final JsBoolean and(JsBoolean other) {
0833         return Js.and(this, other);
0834     }
0835 
0836     /**
0837      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
0838      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
0839      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
0840      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
0841      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
0842      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
0843      * its first operand, the expression on its left. If the value of this expression can 
0844      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
0845      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
0846      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
0847      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
0848      * and doesn't return the unconverted value of the left-side expression.</p>
0849      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0850      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0851      * anonymously, returning the actual expression in the method overriding 
0852      * {@link Var#var()}.</p>
0853      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
0854      * operands that include side effects, unless you purposely want to use the fact that 
0855      * the right-side expression may not be evaluated in JavaScript.</p>
0856      * <p>Even when this operation is used with operands that are not boolean values, it 
0857      * can still be considered a Boolean OR operator because its return value, whatever the 
0858      * type, can be converted to a boolean value.</p>
0859      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0860      * re-compilations. However, in most cases you can use the logical OR operator of the 
0861      * Java language like this:
0862      * <pre>Js.be(var) || Js.be(other)</pre>
0863      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0864      * JavaScript expression since the Java compilers generally used are free to compile 
0865      * the expression into any byte codes they think efficient, making it too hard for the 
0866      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0867      * @param other A value or object.
0868      * @return The logical OR of the two operands.
0869      * @since 1.0
0870      * @javascript Re-compilers must replace the instance invocation of this method with the 
0871      * JavaScript expression:
0872      * <pre>a || other</pre>
0873      * where <tt>a</tt> is the current instance of the invocation of this method.
0874      */
0875     public final Object or(Object other) {
0876         return Js.or(this, other);
0877     }
0878 
0879     /**
0880      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
0881      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
0882      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
0883      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
0884      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
0885      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
0886      * its first operand, the expression on its left. If the value of this expression can 
0887      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
0888      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
0889      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
0890      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
0891      * and doesn't return the unconverted value of the left-side expression.</p>
0892      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0893      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0894      * anonymously, returning the actual expression in the method overriding 
0895      * {@link Var#var()}.</p>
0896      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
0897      * operands that include side effects, unless you purposely want to use the fact that 
0898      * the right-side expression may not be evaluated in JavaScript.</p>
0899      * <p>Even when this operation is used with operands that are not boolean values, it 
0900      * can still be considered a Boolean OR operator because its return value, whatever the 
0901      * type, can be converted to a boolean value.</p>
0902      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0903      * re-compilations. However, in most cases you can use the logical OR operator of the 
0904      * Java language like this:
0905      * <pre>Js.be(var) || Js.be(other)</pre>
0906      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0907      * JavaScript expression since the Java compilers generally used are free to compile 
0908      * the expression into any byte codes they think efficient, making it too hard for the 
0909      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0910      * @param other A value or object.
0911      * @return The logical OR of the two operands.
0912      * @since 1.0
0913      * @javascript Re-compilers must replace the instance invocation of this method with the 
0914      * JavaScript expression:
0915      * <pre>a || other</pre>
0916      * where <tt>a</tt> is the current instance of the invocation of this method.
0917      */
0918     public final JsBoolean or(Boolean other) {
0919         return Js.or(this, other);
0920     }
0921 
0922     /**
0923      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
0924      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
0925      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
0926      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
0927      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
0928      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
0929      * its first operand, the expression on its left. If the value of this expression can 
0930      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
0931      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
0932      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
0933      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
0934      * and doesn't return the unconverted value of the left-side expression.</p>
0935      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0936      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0937      * anonymously, returning the actual expression in the method overriding 
0938      * {@link Var#var()}.</p>
0939      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
0940      * operands that include side effects, unless you purposely want to use the fact that 
0941      * the right-side expression may not be evaluated in JavaScript.</p>
0942      * <p>Even when this operation is used with operands that are not boolean values, it 
0943      * can still be considered a Boolean OR operator because its return value, whatever the 
0944      * type, can be converted to a boolean value.</p>
0945      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0946      * re-compilations. However, in most cases you can use the logical OR operator of the 
0947      * Java language like this:
0948      * <pre>Js.be(var) || Js.be(other)</pre>
0949      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0950      * JavaScript expression since the Java compilers generally used are free to compile 
0951      * the expression into any byte codes they think efficient, making it too hard for the 
0952      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0953      * @param other A value or object.
0954      * @return The logical OR of the two operands.
0955      * @since 1.0
0956      * @javascript Re-compilers must replace the instance invocation of this method with the 
0957      * JavaScript expression:
0958      * <pre>a || other</pre>
0959      * where <tt>a</tt> is the current instance of the invocation of this method.
0960      */
0961     public final JsBoolean or(Value<Boolean> other) {
0962         return Js.or(this, other);
0963     }
0964 
0965     /**
0966      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
0967      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
0968      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
0969      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
0970      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
0971      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
0972      * its first operand, the expression on its left. If the value of this expression can 
0973      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
0974      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
0975      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
0976      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
0977      * and doesn't return the unconverted value of the left-side expression.</p>
0978      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
0979      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
0980      * anonymously, returning the actual expression in the method overriding 
0981      * {@link Var#var()}.</p>
0982      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
0983      * operands that include side effects, unless you purposely want to use the fact that 
0984      * the right-side expression may not be evaluated in JavaScript.</p>
0985      * <p>Even when this operation is used with operands that are not boolean values, it 
0986      * can still be considered a Boolean OR operator because its return value, whatever the 
0987      * type, can be converted to a boolean value.</p>
0988      * <p>Note that, this method is probably useful in emulation codes just for perfect 
0989      * re-compilations. However, in most cases you can use the logical OR operator of the 
0990      * Java language like this:
0991      * <pre>Js.be(var) || Js.be(other)</pre>
0992      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
0993      * JavaScript expression since the Java compilers generally used are free to compile 
0994      * the expression into any byte codes they think efficient, making it too hard for the 
0995      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
0996      * @param other A value or object.
0997      * @return The logical OR of the two operands.
0998      * @since 1.0
0999      * @javascript Re-compilers must replace the instance invocation of this method with the 
1000      * JavaScript expression:
1001      * <pre>a || other</pre>
1002      * where <tt>a</tt> is the current instance of the invocation of this method.
1003      */
1004     public final JsObject or(Var<? extends JsObject> other) {
1005         return Js.or(this, other);
1006     }
1007 
1008     /**
1009      * <p>Logical OR operation, resembling that of JavaScript, performs the Boolean OR 
1010      * operation on the two values: it returns <tt>true</tt> if either the first operand or 
1011      * the second operand is <tt>true</tt>, or if both are <tt>true</tt>. If both operands 
1012      * are <tt>false</tt>, it returns <tt>false</tt>.</p>
1013      * <p>In JavaScript, although the || operator is most often used simply as a Boolean OR 
1014      * operator, it, like the && operator, has more complex behavior. It starts by evaluating 
1015      * its first operand, the expression on its left. If the value of this expression can 
1016      * be converted to <tt>true</tt>, it returns the unconverted value of the left-side 
1017      * expression. Otherwise, it evaluates its second operand, the expression on its right, 
1018      * and returns the value of that expression. In JavaScript 1.0 and JavaScript 1.1, if the 
1019      * left-side expression can be converted to <tt>true</tt>, the operator returns <tt>true</tt> 
1020      * and doesn't return the unconverted value of the left-side expression.</p>
1021      * <p>To make the second operand really late-evaluated or not evaluated in JS Simulation 
1022      * mode, resembling what happens in JavaScript, you may have to extend {@link Var} 
1023      * anonymously, returning the actual expression in the method overriding 
1024      * {@link Var#var()}.</p>
1025      * <p>As with the {@link #and(Object)} operation, you should avoid right-side 
1026      * operands that include side effects, unless you purposely want to use the fact that 
1027      * the right-side expression may not be evaluated in JavaScript.</p>
1028      * <p>Even when this operation is used with operands that are not boolean values, it 
1029      * can still be considered a Boolean OR operator because its return value, whatever the 
1030      * type, can be converted to a boolean value.</p>
1031      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1032      * re-compilations. However, in most cases you can use the logical OR operator of the 
1033      * Java language like this:
1034      * <pre>Js.be(var) || Js.be(other)</pre>
1035      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1036      * JavaScript expression since the Java compilers generally used are free to compile 
1037      * the expression into any byte codes they think efficient, making it too hard for the 
1038      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1039      * @param other A value or object.
1040      * @return The logical OR of the two operands.
1041      * @since 1.0
1042      * @javascript Re-compilers must replace the instance invocation of this method with the 
1043      * JavaScript expression:
1044      * <pre>a || other</pre>
1045      * where <tt>a</tt> is the current instance of the invocation of this method.
1046      */
1047     public final JsBoolean or(JsBoolean other) {
1048         return Js.or(this, other);
1049     }
1050 
1051     /**
1052      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1053      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1054      * operand, otherwise.</p>
1055      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1056      * boolean value. Usually this is the result of a comparison operation. The second and 
1057      * third operands may have any value. The value returned by the conditional operation 
1058      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1059      * the value of the conditional expression is the value of the second operand. If the 
1060      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1061      * value of the third operand.</p>
1062      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1063      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1064      * {@link Var} anonymously, returning the actual expression in the method overriding 
1065      * {@link Var#var()}.</p>
1066      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1067      * re-compilations. However, in most cases you can use the conditional operator of the 
1068      * Java language like this:
1069      * <pre>Js.be(test) ? var : other</pre>
1070      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1071      * JavaScript expression since the Java compilers generally used are free to compile 
1072      * the expression into any byte codes they think efficient, making it too hard for the 
1073      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1074      * @param other A value or object.
1075      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1076      * the third operand.
1077      * @since 1.0
1078      * @javascript Re-compilers must replace the instance invocation of this method with the 
1079      * JavaScript expression:
1080      * <pre>test ? a : other</pre>
1081      * where <tt>a</tt> is the current instance of the invocation of this method.
1082      */
1083     public final Object cond(Object test, Object other) {
1084         return Js.cond(test, this, other);
1085     }
1086 
1087     /**
1088      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1089      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1090      * operand, otherwise.</p>
1091      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1092      * boolean value. Usually this is the result of a comparison operation. The second and 
1093      * third operands may have any value. The value returned by the conditional operation 
1094      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1095      * the value of the conditional expression is the value of the second operand. If the 
1096      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1097      * value of the third operand.</p>
1098      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1099      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1100      * {@link Var} anonymously, returning the actual expression in the method overriding 
1101      * {@link Var#var()}.</p>
1102      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1103      * re-compilations. However, in most cases you can use the conditional operator of the 
1104      * Java language like this:
1105      * <pre>Js.be(test) ? var : other</pre>
1106      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1107      * JavaScript expression since the Java compilers generally used are free to compile 
1108      * the expression into any byte codes they think efficient, making it too hard for the 
1109      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1110      * @param other A value or object.
1111      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1112      * the third operand.
1113      * @since 1.0
1114      * @javascript Re-compilers must replace the instance invocation of this method with the 
1115      * JavaScript expression:
1116      * <pre>test ? a : other</pre>
1117      * where <tt>a</tt> is the current instance of the invocation of this method.
1118      */
1119     public final JsObject cond(Object test, Var<? extends JsObject> other) {
1120         return Js.cond(test, this, other);
1121     }
1122 
1123 
1124     /**
1125      * <p>Conditional operation, resembling the ternary operator of JavaScript, returns the 
1126      * second operand if the first operand evaluates to <tt>true</tt>; Returns the third 
1127      * operand, otherwise.</p>
1128      * <p>The first operand of the conditional operation must be (or be convertible to) a 
1129      * boolean value. Usually this is the result of a comparison operation. The second and 
1130      * third operands may have any value. The value returned by the conditional operation 
1131      * depends on the boolean value of the first operand. If that operand is <tt>true</tt>, 
1132      * the value of the conditional expression is the value of the second operand. If the 
1133      * first operand is <tt>false</tt>, the value of the conditional expression is the 
1134      * value of the third operand.</p>
1135      * <p>To make the second and third operands really late-evaluated or not evaluated in 
1136      * JS Simulation mode, resembling what happens in JavaScript, you may have to extend 
1137      * {@link Var} anonymously, returning the actual expression in the method overriding 
1138      * {@link Var#var()}.</p>
1139      * <p>Note that, this method is probably useful in emulation codes just for perfect 
1140      * re-compilations. However, in most cases you can use the conditional operator of the 
1141      * Java language like this:
1142      * <pre>Js.be(test) ? var : other</pre>
1143      * which is definitely late-evaluated but not necessarily re-compiled into an expected 
1144      * JavaScript expression since the Java compilers generally used are free to compile 
1145      * the expression into any byte codes they think efficient, making it too hard for the 
1146      * re-compilers to reconvert the byte codes to an expression in JavaScript.</p>
1147      * @param other A value or object.
1148      * @return The second operand if the first operand evaluates to <tt>true</tt>; Otherwise, 
1149      * the third operand.
1150      * @since 1.0
1151      * @javascript Re-compilers must replace the instance invocation of this method with the 
1152      * JavaScript expression:
1153      * <pre>test ? a : other</pre>
1154      * where <tt>a</tt> is the current instance of the invocation of this method.
1155      */
1156     public final JsBoolean cond(Object test, JsBoolean other) {
1157         return Js.cond(test, this, other);
1158     }
1159 }