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;
0021 
0022 import js.core.*;
0023 import js.user.*;
0024 
0025 /**
0026  * <p>An abstract <b>internal</b> class for JS Simulation.</p>
0027  * <p>This <b>internal</b> class is only extended internally in JS Simulation Library or 
0028  * used externally in calling {@link Js#init(Sim)} and JS developers must follow this rule 
0029  * to ensure this class and its subclasses invisible to JS re-compilers which start 
0030  * processing at {@link JsApplet#onReady()}.</p>
0031  *
0032  * @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>
0033  * @see Js#init(Sim)
0034  * 
0035  * @javascript Re-compilers must report error on resolving an <tt>internal</tt> class. 
0036  * To keep this class invisible to the re-compilers themselves, they must ignore the static 
0037  * <tt>main</tt> methods of {@link JsApplet} and its subclasses, if there are the ones, 
0038  * which may have the {@link Js#init(Sim)} calls and would cause resolving this class. 
0039  */
0040 
0041 public abstract class Sim extends Var<Void>
0042 {
0043     /**
0044      * <p>Internally constructs a JS Simulation.</p>
0045      * @since 1.0
0046      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor. 
0047      */
0048     protected Sim() {}
0049 
0050     /**
0051      * <p>Use unsupported. For clearance of subclasses.</p>
0052      * @since 1.0
0053      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0054      */
0055     @Override
0056     public final Void var() {
0057         throw new UnsupportedOperationException();
0058     }
0059 
0060     /**
0061      * <p>Returns the opaque global object with the core support only.</p>
0062      * @return The opaque global object with the core support only.
0063      * @see Js#core()
0064      * @see jsx.client.Global
0065      * @since 1.0
0066      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0067      */
0068     protected abstract JsGlobal core();
0069     /**
0070      * <p>Returns the opaque global object with the client-side support.</p>
0071      * @return The opaque global object with the client-side support.
0072      * @see Js#win()
0073      * @see jsx.client.Client
0074      * @since 1.0
0075      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0076      */
0077     protected abstract JsWin win();
0078 
0079     /**
0080      * <p>Displays a simple message in a dialog box.</p>
0081      * <p>In JavaScript, this method displays the specified <tt>message</tt> to the 
0082      * user in a dialog box. The dialog box contains an OK button the user can click to 
0083      * dismiss it. The dialog box is typically modal, and the call to this function 
0084      * typically blocks until the dialog is dismissed.</p>
0085      * <p>Perhaps the most common use of this method is to display error messages when the 
0086      * user's input to some form element is invalid in some way. The alert dialog box can 
0087      * inform the user of the problem and explain what needs to be corrected to avoid the 
0088      * problem in the future</p>
0089      * <p>The appearance of the dialog box is platform-dependent, but it generally contains 
0090      * graphics that indicate an error, warning, or alert message of some kind. While it can 
0091      * display any desired message, the alert graphics of the dialog box mean that this 
0092      * method is not appropriate for simple informational messages like "Welcome to my blog"</p>
0093      * <p>Note that the <tt>message</tt> displayed in the dialog box is a string of 
0094      * plain text, not formatted HTML. You can use the newline character "\n" in your strings 
0095      * to break your message across multiple lines. You can also do some rudimentary 
0096      * formatting using spaces and can approximate horizontal rules with underscore characters, 
0097      * but the results depend greatly on the font used in the dialog box and thus are 
0098      * system-dependent.</p>
0099      * @param message The plain-text (not HTML) string to display in a dialog box popped up 
0100      * over the current window.
0101      * @see Js#alert(Object)
0102      * @see jsx.client.Global#alert(Object)
0103      * @see jsx.client.Client#alert(Object)
0104      * @since 1.0
0105      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0106      */
0107     protected abstract void alert(Object message);
0108     /**
0109      * <p>Asks a yes-or-no question with a dialog box.</p>
0110      * <p>In JavaScript, this method displays the specified question in a dialog box. The 
0111      * dialog box contains OK and Cancel buttons that the user can use to answer the 
0112      * question. If the user clicks the OK button, it returns <tt>true</tt>. If the 
0113      * user clicks Cancel, it returns <tt>false</tt>.</p>
0114      * <p>The dialog box that is displayed by the this method is modal. That is, it blocks 
0115      * all user input to the main browser window until the user dismisses the dialog box 
0116      * by clicking on the OK or Cancel buttons. Since this method returns a value depending 
0117      * on the user's response to the dialog box, JavaScript execution pauses in the call to 
0118      * this method, and subsequent statements are not executed until the user responds to 
0119      * the dialog box.</p>
0120      * <p>There is no way to change the labels that appear in the buttons of the dialog box 
0121      * (to make them read Yes and No, for example). Therefore, you should take care to 
0122      * phrase your question or message so that OK and Cancel are suitable responses.</p>
0123      * @param question The plain-text (not HTML) string to be displayed in the dialog box. 
0124      * It should generally express a question you want the user to answer.
0125      * @return <tt>true</tt> if the user clicks the OK button; <tt>false</tt> if 
0126      * the user clicks the Cancel button.
0127      * @see Js#confirm(Object)
0128      * @see jsx.client.Global#confirm(Object)
0129      * @see jsx.client.Client#confirm(Object)
0130      * @since 1.0
0131      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0132      */
0133     protected abstract boolean confirm(Object question);
0134     /**
0135      * <p>Asks for simple string input with a dialog box.</p>
0136      * <p>This method displays text input field and OK and Cancel buttons in a dialog box. 
0137      * Platform-dependent graphics in the dialog box help indicate to the user that an 
0138      * input is desired.</p>
0139      * <p>If the user clicks the Cancel button, the method returns <tt>null</tt>. If 
0140      * the user clicks the OK button, it returns the text currently displayed in the 
0141      * input field.</p>
0142      * <p>The dialog box that is displayed by this method is modal. That is, it blocks all 
0143      * user input to the main browser window until the user dismisses the dialog box by 
0144      * clicking on the OK or Cancel buttons. Since this method returns a value depending 
0145      * on the user's response to the dialog box, JavaScript execution pauses in the call 
0146      * to this method, and subsequent statements are not executed until the user responds 
0147      * to the dialog box.</p>
0148      * @param message The plain-text (not HTML) string to be displayed in the dialog box. 
0149      * It should ask the user to enter the information you want.
0150      * @return The string entered by the user, the empty string if the user did not enter 
0151      * a string, or <tt>null</tt> if the user clicked Cancel.
0152      * @see #prompt(Object, Object)
0153      * @see Js#prompt(Object)
0154      * @see jsx.client.Global#prompt(Object)
0155      * @see jsx.client.Client#prompt(Object)
0156      * @since 1.0
0157      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0158      */
0159     protected abstract String prompt(Object message);
0160     /**
0161      * <p>Asks for simple string input with a dialog box.</p>
0162      * <p>This method displays the specified message in a dialog box that also contains a 
0163      * text input field and OK and Cancel buttons. Platform-dependent graphics in the 
0164      * dialog box help indicate to the user that an input is desired.</p>
0165      * <p>If the user clicks the Cancel button, the method returns <tt>null</tt>. If 
0166      * the user clicks the OK button, it returns the text currently displayed in the 
0167      * input field.</p>
0168      * <p>The dialog box that is displayed by this method is modal. That is, it blocks all 
0169      * user input to the main browser window until the user dismisses the dialog box by 
0170      * clicking on the OK or Cancel buttons. Since this method returns a value depending 
0171      * on the user's response to the dialog box, JavaScript execution pauses in the call 
0172      * to this method, and subsequent statements are not executed until the user responds 
0173      * to the dialog box.</p>
0174      * @param message The plain-text (not HTML) string to be displayed in the dialog box. 
0175      * It should ask the user to enter the information you want.
0176      * @param defaultInput A string that is displayed as the default input in the dialog 
0177      * box. Pass the empty string ("") to make the method display an empty input box.
0178      * @return The string entered by the user, the empty string if the user did not enter 
0179      * a string, or <tt>null</tt> if the user clicked Cancel.
0180      * @see #prompt(Object)
0181      * @see Js#prompt(Object, Object)
0182      * @see jsx.client.Global#prompt(Object, Object)
0183      * @see jsx.client.Client#prompt(Object, Object)
0184      * @since 1.0
0185      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0186      */
0187     protected abstract String prompt(Object message, Object defaultInput);
0188     /**
0189      * <p>Cancels periodic execution of code.</p>
0190      * <p>This method stops the repeated execution of code that was started by a call to 
0191      * {@link #setInterval(JsFunction, Number)}. <tt>intervalId</tt> must be the value 
0192      * that was returned by a call to {@link #setInterval(JsFunction, Number)}.</p>
0193      * @param intervalId The value returned by the corresponding call to {@link #setInterval(JsFunction, Number)}.
0194      * @see #setInterval(JsFunction, Number)
0195      * @see Js#clearInterval(Object)
0196      * @see jsx.client.Global#clearInterval(Object)
0197      * @see jsx.client.Client#clearInterval(Object)
0198      * @see jsx.Interval
0199      * @since 1.0
0200      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0201      */
0202     protected abstract void clearInterval(Object intervalId);
0203     /**
0204      * <p>Cancels a pending timeout operation.</p>
0205      * <p>This method cancels the execution of code that has been deferred with the 
0206      * {@link #setTimeout(JsFunction, Number)} method. The <tt>timeoutId</tt> argument 
0207      * is a value returned by the call to {@link #setTimeout(JsFunction, Number)} and 
0208      * identifies which deferred code to cancel.</p>
0209      * @param timeoutId A value returned by {@link #setTimeout(JsFunction, Number)} that 
0210      * identifies the timeout to be canceled.
0211      * @see #clearTimeout(Object)
0212      * @see Js#clearTimeout(Object)
0213      * @see jsx.client.Global#clearTimeout(Object)
0214      * @see jsx.client.Client#clearTimeout(Object)
0215      * @see jsx.Timeout
0216      * @since 1.0
0217      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0218      */
0219     protected abstract void clearTimeout(Object timeoutId);
0220     /**
0221      * <p>Executes code at periodic intervals.</p>
0222      * <p>Note that the specified function is executed in the context of the Window object, 
0223      * that is, the Window object is the value of the <tt>this</tt> keyword of the 
0224      * executing context of the function. This is <tt>true</tt> even if the call to 
0225      * {@link #setTimeout(JsFunction, Number)} occurred within a function with a longer 
0226      * scope chain.</p>
0227      * @param f A function to be periodically invoked.
0228      * @param interval The interval, in milliseconds, between invocations of the function.
0229      * @return A value that can be passed to {@link #clearInterval(Object)} method to 
0230      * cancel the periodic execution of the function.
0231      * @see #clearInterval(Object)
0232      * @see Js#setInterval(JsFunction)
0233      * @see Js#setInterval(JsFunction, Number)
0234      * @see jsx.client.Global#setInterval(JsFunction)
0235      * @see jsx.client.Global#setInterval(JsFunction, Number)
0236      * @see jsx.client.Client#setInterval(JsFunction)
0237      * @see jsx.client.Client#setInterval(JsFunction, Number)
0238      * @see jsx.Interval
0239      * @since 1.0
0240      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0241      */
0242     protected abstract Object setInterval(JsFunction<?> f, Number interval);
0243     /**
0244      * <p>Executes code after a specified amount of time elapses.</p>
0245      * <p>Note that this method executes the specified function only once. The function is 
0246      * executed in the context of the Window object, that is, the Window object is the 
0247      * value of the <tt>this</tt> keyword of the executing context of the function. 
0248      * This is <tt>true</tt> even if the call to {@link #setTimeout(JsFunction, Number)} 
0249      * occurred within a function with a longer scope chain.</p>
0250      * @param f A function to be invoked after the <tt>delay</tt> has elapsed.
0251      * @param delay The amount of time, in milliseconds, before the function should be executed.
0252      * @return A value that can be passed to the {@link #clearTimeout(Object)} method to 
0253      * cancel the execution of the function.
0254      * @see #clearTimeout(Object)
0255      * @see Js#setTimeout(JsFunction)
0256      * @see Js#setTimeout(JsFunction, Number)
0257      * @see jsx.client.Global#setTimeout(JsFunction)
0258      * @see jsx.client.Global#setTimeout(JsFunction, Number)
0259      * @see jsx.client.Client#setTimeout(JsFunction)
0260      * @see jsx.client.Client#setTimeout(JsFunction, Number)
0261      * @see jsx.Timeout
0262      * @since 1.0
0263      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0264      */
0265     protected abstract Object setTimeout (JsFunction<?> f, Number delay);
0266     /**
0267      * <p>Decodes a string escaped with {@link #encodeURI(Object)}.</p>
0268      * @param s A string that contains an encoded URI or other text to be decoded.
0269      * @return A copy of <tt>s</tt>, with any hexadecimal escape sequences replaced with 
0270      * the characters they represent.
0271      * @throws RuntimeException JavaScript throws a <tt>URIError</tt> if one or more of the 
0272      * escape sequences in <tt>s</tt> is malformed and cannot be correctly decoded. See 
0273      * {@link Js#err(Object)} and {@link js.core.JsURIError} for JS Simulation.
0274      * @see #encodeURI(Object)
0275      * @see Js#decodeURI(Object)
0276      * @see jsx.client.Global#decodeURI(Object)
0277      * @see jsx.client.Client#decodeURI(Object)
0278      * @since 1.0
0279      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0280      */
0281     protected abstract String decodeURI(Object s);
0282     /**
0283      * <p>Decodes a string escaped with {@link #encodeURIComponent(Object)}.</p>
0284      * @param s A string that contains an encoded URI component or other text to be decoded.
0285      * @return A copy of <tt>s</tt>, with any hexadecimal escape sequences replaced 
0286      * with the characters they represent.
0287      * @throws RuntimeException JavaScript throws a <tt>URIError</tt> if one or more of the 
0288      * escape sequences in <tt>s</tt> is malformed and cannot be correctly decoded. See 
0289      * {@link Js#err(Object)} and {@link js.core.JsURIError} for JS Simulation.
0290      * @see #encodeURIComponent(Object)
0291      * @see Js#decodeURIComponent(Object)
0292      * @see jsx.client.Global#decodeURIComponent(Object)
0293      * @see jsx.client.Client#decodeURIComponent(Object)
0294      * @since 1.0
0295      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0296      */
0297     protected abstract String decodeURIComponent(Object s);
0298     /**
0299      * <p>Encodes a URI by escaping certain characters.</p>
0300      * @param uri A string that contains the URI or other text to be encoded.
0301      * @return A copy of <tt>uri</tt>, with any hexadecimal escape sequences replaced 
0302      * with the characters they represent..
0303      * @throws RuntimeException JavaScript throws a <tt>URIError</tt> if <tt>s</tt> 
0304      * contains malformed unicode surrogate pairs and cannot be encoded. See 
0305      * {@link Js#err(Object)} and {@link js.core.JsURIError} for JS Simulation.
0306      * @see #decodeURI(Object)
0307      * @see Js#encodeURI(Object)
0308      * @see jsx.client.Global#encodeURI(Object)
0309      * @see jsx.client.Client#encodeURI(Object)
0310      * @since 1.0
0311      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0312      */
0313     protected abstract String encodeURI(Object uri);
0314     /**
0315      * <p>Encodes a URI component by escaping certain characters.</p>
0316      * @param uri A string that contains a portion of a URI or other text to be encoded.
0317      * @return The opaque global object with the client-side support.
0318      * @throws RuntimeException JavaScript throws a <tt>URIError</tt> if <tt>s</tt> 
0319      * contains malformed unicode surrogate pairs and cannot be encoded. See 
0320      * {@link Js#err(Object)} and {@link js.core.JsURIError} for JS Simulation.
0321      * @see #decodeURIComponent(Object)
0322      * @see Js#encodeURIComponent(Object)
0323      * @see jsx.client.Global#encodeURIComponent(Object)
0324      * @see jsx.client.Client#encodeURIComponent(Object)
0325      * @since 1.0
0326      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0327      */
0328     protected abstract String encodeURIComponent(Object uri);
0329     /**
0330      * <p>Encodes a string by replacing certain characters with escape sequences.</p>
0331      * @param s The string that is to be "escaped" or encoded.
0332      * @return An encoded copy of <tt>s</tt> in which certain characters have been 
0333      * replaced by hexadecimal escape sequences.
0334      * @see #unescape(Object)
0335      * @see Js#escape(Object)
0336      * @see jsx.client.Global#escape(Object)
0337      * @see jsx.client.Client#escape(Object)
0338      * @since 1.0
0339      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0340      */
0341     protected abstract String escape(Object s);
0342     /**
0343      * <p>Decodes a string encoded with {@link #escape(Object)}.</p>
0344      * @param s The string that is to be decoded or "unescaped".
0345      * @return A decoded copy of <tt>s</tt>.
0346      * @see #escape(Object)
0347      * @see Js#unescape(Object)
0348      * @see jsx.client.Global#unescape(Object)
0349      * @see jsx.client.Client#unescape(Object)
0350      * @since 1.0
0351      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0352      */
0353     protected abstract String unescape(Object s);
0354     /**
0355      * <p>Evaluates the argument string as JavaScript code and returns the result.</p>
0356      * <p>In JavaScript, <tt>eval()</tt> is a global method that evaluates a string of 
0357      * JavaScript code in the current lexical scope. If the code contains an expression, 
0358      * eval evaluates the expression and returns its value. If the code contains a 
0359      * JavaScript statement or statements, it executes those statements and returns the 
0360      * value, if any, returned by the last statement. If the code does not return any 
0361      * value, <tt>eval()</tt> returns undefined. Finally, if code throws an exception, 
0362      * <tt>eval()</tt> passes that exception on to the caller.</p>
0363      * <p>The global function <tt>eval()</tt> provides a very powerful capability to 
0364      * the JavaScript language, but its use is infrequent in real-world programs. 
0365      * Obvious uses are to write programs that act as recursive JavaScript interpreters 
0366      * and to write programs that dynamically generate and evaluate JavaScript code.</p>
0367      * <p>Most JavaScript functions and methods that expect string arguments accept 
0368      * arguments of other types as well and simply convert those argument values to 
0369      * strings before proceeding. <tt>eval()</tt> does not behave like this. If the 
0370      * code argument is not a primitive string, it is simply returned unchanged. Be 
0371      * careful, therefore, that you do not inadvertently pass a String object to 
0372      * <tt>eval()</tt> when you intended to pass a primitive string value.</p>
0373      * <p>For purposes of implementation efficiency, the ECMAScript v3 standard places 
0374      * an unusual restriction on the use of <tt>eval()</tt>. An ECMAScript implementation 
0375      * is allowed to throw an <tt>EvalError</tt> exception if you attempt to overwrite 
0376      * the <tt>eval</tt> property or if you assign the <tt>eval()</tt> method to another 
0377      * property and attempt to invoke it through that property.</p>
0378      * @param s A string of JavaScript code.
0379      * @return The return value of the evaluated code, if any.
0380      * @throws RuntimeException JavaScript throws a <tt>SyntaxError</tt> if the argument string 
0381      * does not contain legal JavaScript, a <tt>EvalError</tt> if the <tt>eval</tt> function 
0382      * was called illegally, through an identifier other than "eval", or other JavaScript error 
0383      * generated by the code passed. See {@link Js#err(Object)}, {@link js.core.JsSyntaxError}, 
0384      * {@link js.core.JsEvalError}, and {@link js.core.JsError} for JS Simulation.
0385      * @since 1.0
0386      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0387      */
0388     protected abstract Object eval(Object s);
0389     /**
0390      * <p>Tests whether a value is a finite number.</p>
0391      * @param v The number to be tested.
0392      * @return <tt>true</tt> if <tt>v</tt> is (or can be converted to) a finite 
0393      * number, or <tt>false</tt> if <tt>v</tt> is <tt>NaN</tt> (not a number) 
0394      * or positive or negative infinity.
0395      * @see Js#isFinite(Object)
0396      * @see jsx.client.Global#isFinite(Object)
0397      * @see jsx.client.Client#isFinite(Object)
0398      * @since 1.0
0399      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0400      */
0401     protected abstract boolean isFinite(Object v);
0402     /**
0403      * <p>Tests whether a value is the not-a-number value.</p>
0404      * <p>In JavaScript, This function tests its argument to determine whether it is the 
0405      * value <tt>NaN</tt>, which represents an illegal number (such as the result of 
0406      * division by zero). This function is required because comparing a <tt>NaN</tt> 
0407      * with any value, including itself, always returns <tt>false</tt>, so it is not 
0408      * possible to test for <tt>NaN</tt> with the == or === operators.</p>
0409      * <p>A common use in JavaScript of this function is to test the results of {@link #parseFloat(Object)} 
0410      * and {@link #parseInt(Object)} to determine if they represent legal numbers. You can 
0411      * also use {@link #isNaN(Object)} to check for arithmetic errors, such as division by 
0412      * zero</p>
0413      * @param v The value to be tested.
0414      * @return <tt>true</tt> if <tt>v</tt> is (or can be converted to) the special 
0415      * not-a-number value; <tt>false</tt> if <tt>v</tt> is any other value.
0416      * @see Js#isNaN(Object)
0417      * @see jsx.client.Global#isNaN(Object)
0418      * @see jsx.client.Client#isNaN(Object)
0419      * @since 1.0
0420      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0421      */
0422     protected abstract boolean isNaN(Object v);
0423     /**
0424      * <p>Parses an integer from a string.</p>
0425      * <p>In JavaScript, this function parses and returns the first number (with an 
0426      * optional leading minus sign) that occurs in <tt>value</tt>. Parsing stops, and 
0427      * the value is returned, when it encounters a character in <tt>value</tt> that is 
0428      * not a valid digit for the specified radix. If <tt>value</tt> does not begin with 
0429      * a number that it can parse, the function returns the not-a-number value <tt>NaN</tt>. 
0430      * Use the {@link #isNaN(Object)} function to test for this return value.</p>
0431      * @param value The string to be parsed.
0432      * @return The parsed number, or <tt>NaN</tt> if <tt>value</tt> does not begin with 
0433      * a valid integer. In JavaScript 1.0, this function returns 0 instead of <tt>NaN</tt> 
0434      * when it cannot parse <tt>value</tt>.
0435      * @see #parseFloat(Object)
0436      * @see #parseInt(Object, int)
0437      * @see Js#parseInt(Object)
0438      * @see jsx.client.Global#parseInt(Object)
0439      * @see jsx.client.Client#parseInt(Object)
0440      * @since 1.0
0441      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0442      */
0443     protected abstract Integer parseInt(Object value);
0444     /**
0445      * <p>Parses an integer from a string in a base specified.</p>
0446      * <p>In JavaScript, this function parses and returns the first number (with an 
0447      * optional leading minus sign) that occurs in <tt>value</tt>. Parsing stops, and 
0448      * the value is returned, when it encounters a character in <tt>value</tt> that is 
0449      * not a valid digit for the specified radix. If <tt>value</tt> does not begin with 
0450      * a number that it can parse, the function returns the not-a-number value <tt>NaN</tt>. 
0451      * Use the {@link #isNaN(Object)} function to test for this return value.</p>
0452      * <p>The <tt>radix</tt> argument specifies the base of the number to be parsed. 
0453      * Specifying 10 makes this function parse a decimal number. The value 8 specifies that 
0454      * an octal number (using digits 0 through 7) is to be parsed. The value 16 specifies 
0455      * a hexadecimal value, using digits 0 through 9 and letters A through F. <tt>radix</tt> 
0456      * can be any value between 2 and 36.</p>
0457      * <p>If <tt>radix</tt> is 0 or is undefined, this function tries to determine the 
0458      * radix of the number from <tt>value</tt>. If <tt>value</tt> begins (after an 
0459      * optional minus sign) with 0x, it parses the remainder of <tt>value</tt> as a 
0460      * hexadecimal number. If <tt>value</tt> begins with a 0, the ECMAScript v3 standard 
0461      * allows an implementation of this function to interpret the following characters as 
0462      * an octal number or as a decimal number. Otherwise, if <tt>value</tt> begins with 
0463      * a digit from 1 through 9, it parses it as a decimal number</p>
0464      * @param value The string to be parsed.
0465      * @param radix An optional integer argument that represents the radix (or base) of the 
0466      * number to be parsed. If this argument is undefined or is 0, the number is parsed in 
0467      * base 10 or in base 16 if it begins with 0x or 0X. If this argument is less than 2 or 
0468      * greater than 36, <tt>NaN</tt> is returned.
0469      * @return The parsed number, or <tt>NaN</tt> if <tt>value</tt> does not begin with 
0470      * a valid integer. In JavaScript 1.0, this function returns 0 instead of <tt>NaN</tt> 
0471      * when it cannot parse <tt>value</tt>.
0472      * @see #parseInt(Object)
0473      * @see Js#parseInt(Object, int)
0474      * @see jsx.client.Global#parseInt(Object, int)
0475      * @see jsx.client.Client#parseInt(Object, int)
0476      * @since 1.0
0477      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0478      */
0479     protected abstract Integer parseInt(Object value, int radix);
0480     /**
0481      * <p>Parses a number from a string.</p>
0482      * <p>In JavaScript, this function parses and returns the first number that occurs in 
0483      * <tt>value</tt>. Parsing stops, and the value is returned, when it encounters a 
0484      * character in <tt>value</tt> that is not a valid part of the number. If <tt>value</tt> 
0485      * does not begin with a number that it can parse, the function returns the not-a-number 
0486      * value <tt>NaN</tt>. Test for this return value with the {@link #isNaN(Object)} 
0487      * function. If you want to parse only the integer portion of a number, use {@link #parseInt(Object)} 
0488      * or {@link #parseInt(Object, int)} instead of this one.</p>
0489      * @param value The string to be parsed and converted to a number.
0490      * @return The parsed number, or <tt>NaN</tt> if <tt>value</tt> does not begin 
0491      * with a valid number. In JavaScript 1.0, this function returns 0 instead of <tt>NaN</tt> 
0492      * when <tt>value</tt> cannot be parsed as a number.
0493      * @see #parseInt(Object)
0494      * @see Js#parseFloat(Object)
0495      * @see jsx.client.Global#parseFloat(Object)
0496      * @see jsx.client.Client#parseFloat(Object)
0497      * @since 1.0
0498      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0499      */
0500     protected abstract Double parseFloat(Object value);
0501 
0502     /**
0503      * <p>Creates and return a <tt>Cases</tt> cache.</p>
0504      * @return The newly created <tt>Cases</tt> cache.
0505      * @since 1.0
0506      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0507      */
0508     protected abstract Cases cases();
0509     /**
0510      * <p>Gets the list of the property names of an object.</p>
0511      * @param o The object.
0512      * @return The list of the property names of the object.
0513      * @since 1.0
0514      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0515      */
0516     protected abstract ArrayLike<String> keys(ObjectLike o);
0517     /**
0518      * <p>Copies all the properties of <tt>a</tt> to <tt>o</tt>.</p>
0519      * @param o The object that the properties being copied to.
0520      * @param a The object that the properties being copied from.
0521      * @since 1.0
0522      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0523      */
0524     protected abstract void apply(ObjectLike o, ObjectLike a);
0525 
0526     /**
0527      * <p>Creates a JavaScript function.</p>
0528      * <p>A function is a fundamental data-type in JavaScript. Note that although functions 
0529      * may be created with this method, this is not efficient, and the preferred way to 
0530      * define functions, in most cases, is to extend {@link Function}.</p>
0531      * @param args A list of the argument values, each naming one or more arguments of the 
0532      * function being created, ended with a string that specifies the body of the function.
0533      * @return A newly created function. Invoking it executes the JavaScript code specified 
0534      * by last string value of the variable argument <tt>args</tt>.
0535      * @throws RuntimeException JavaScript throws a <tt>SyntaxError</tt> if there was a 
0536      * JavaScript syntax error in one of the value of the variable arguments. See {@link Js#err(Object)} 
0537      * and {@link js.core.JsSyntaxError} for JS Simulation.
0538      * @see Function
0539      * @since 1.0
0540      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0541      */
0542     protected abstract <T> JsFunction<T> function(Vars<String> args);
0543     /**
0544      * <p>Gets the value or object contained in a <tt>RuntimeException</tt> object 
0545      * thrown by JS Simulation.</p>
0546      * @param e The <tt>RuntimeException</tt> object thrown by JS Simulation.
0547      * @return The value or object contained in the <tt>RuntimeException</tt> object.
0548      * @since 1.0
0549      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0550      */
0551     protected abstract Object err(RuntimeException e);
0552     /**
0553      * <p>Creates an integer literal.</p>
0554      * <p>This method is used to create formatted integer literal in re-compiled JavaScript 
0555      * code. A re-compiler leaves the literal as it is without even parsing check but JS 
0556      * Simulations parse it to an integer and throws RuntimeException if it is malformatted.</p>
0557      * @param s The literal text of an integer.
0558      * @return The integer literal.
0559      * @since 1.0
0560      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0561      */
0562     protected abstract int integer(String s);
0563     /**
0564      * <p>Creates a number literal.</p>
0565      * <p>This method is used to create formatted number literal in re-compiled JavaScript 
0566      * code. A re-compiler leaves the literal as it is without even parsing check but JS 
0567      * Simulations parse it to a number and throws RuntimeException if it is malformatted.</p>
0568      * @param s The literal text of a number.
0569      * @return The numberer literal.
0570      * @since 1.0
0571      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0572      */
0573     protected abstract Number number(String s);
0574 
0575     /**
0576      * <p>Creates an empty array.</p>
0577      * @return The empty array.
0578      * @see #array(Object[])
0579      * @see #array(boolean[])
0580      * @see #array(byte[])
0581      * @see #array(char[])
0582      * @see #array(short[])
0583      * @see #array(int[])
0584      * @see #array(long[])
0585      * @see #array(float[])
0586      * @see #array(double[])
0587      * @see Js#array()
0588      * @see Vars#var()
0589      * @see js.core.JsArray#JsArray()
0590      * @see js.core.JsGlobal.Array#create()
0591      * @since 1.0
0592      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0593      */
0594     protected abstract <T> ArrayLike<T> array();
0595     /**
0596      * <p>Gets the array-like representation of a generic array.</p>
0597      * @param a A generic array
0598      * @return The array-like representation.
0599      * @see #array(boolean[])
0600      * @see #array(byte[])
0601      * @see #array(char[])
0602      * @see #array(short[])
0603      * @see #array(int[])
0604      * @see #array(long[])
0605      * @see #array(float[])
0606      * @see #array(double[])
0607      * @see Js#array(Object[])
0608      * @see js.core.JsArray#JsArray(js.core.JsObject)
0609      * @see js.core.JsArray#JsArray(Object[])
0610      * @see js.core.JsGlobal.Array#create(Object)
0611      * @since 1.0
0612      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0613      */
0614     protected abstract <T> ArrayLike<T> array(T[] a);
0615     /**
0616      * <p>Gets the array-like representation of a boolean array.</p>
0617      * @param a A boolean array
0618      * @return The array-like representation.
0619      * @see #array(Object[])
0620      * @see #array(byte[])
0621      * @see #array(char[])
0622      * @see #array(short[])
0623      * @see #array(int[])
0624      * @see #array(long[])
0625      * @see #array(float[])
0626      * @see #array(double[])
0627      * @see Js#array(boolean[])
0628      * @see js.core.JsArray#JsArray(boolean[])
0629      * @see js.core.JsArray#JsArray(js.core.JsObject)
0630      * @see js.core.JsGlobal.Array#create(Object)
0631      * @since 1.0
0632      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0633      */
0634     protected abstract ArrayLike<Boolean>   array(boolean[] a);
0635     /**
0636      * <p>Gets the array-like representation of a byte array.</p>
0637      * @param a A byte array
0638      * @return The array-like representation.
0639      * @see #array(Object[])
0640      * @see #array(boolean[])
0641      * @see #array(char[])
0642      * @see #array(short[])
0643      * @see #array(int[])
0644      * @see #array(long[])
0645      * @see #array(float[])
0646      * @see #array(double[])
0647      * @see Js#array(byte[])
0648      * @see js.core.JsArray#JsArray(byte[])
0649      * @see js.core.JsArray#JsArray(js.core.JsObject)
0650      * @see js.core.JsGlobal.Array#create(Object)
0651      * @since 1.0
0652      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0653      */
0654     protected abstract ArrayLike<Byte>      array(byte   [] a);
0655     /**
0656      * <p>Gets the array-like representation of a char array.</p>
0657      * @param a A char array
0658      * @return The array-like representation.
0659      * @see #array(Object[])
0660      * @see #array(boolean[])
0661      * @see #array(byte[])
0662      * @see #array(short[])
0663      * @see #array(int[])
0664      * @see #array(long[])
0665      * @see #array(float[])
0666      * @see #array(double[])
0667      * @see Js#array(char[])
0668      * @see js.core.JsArray#JsArray(char[])
0669      * @see js.core.JsArray#JsArray(js.core.JsObject)
0670      * @see js.core.JsGlobal.Array#create(Object)
0671      * @since 1.0
0672      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0673      */
0674     protected abstract ArrayLike<Character> array(char   [] a);
0675     /**
0676      * <p>Gets the array-like representation of a short array.</p>
0677      * @param a A short array
0678      * @return The array-like representation.
0679      * @see #array(Object[])
0680      * @see #array(boolean[])
0681      * @see #array(byte[])
0682      * @see #array(char[])
0683      * @see #array(int[])
0684      * @see #array(long[])
0685      * @see #array(float[])
0686      * @see #array(double[])
0687      * @see Js#array(short[])
0688      * @see js.core.JsArray#JsArray(short[])
0689      * @see js.core.JsArray#JsArray(js.core.JsObject)
0690      * @see js.core.JsGlobal.Array#create(Object)
0691      * @since 1.0
0692      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0693      */
0694     protected abstract ArrayLike<Short>     array(short  [] a);
0695     /**
0696      * <p>Gets the array-like representation of an int array.</p>
0697      * @param a An int array
0698      * @return The array-like representation.
0699      * @see #array(Object[])
0700      * @see #array(boolean[])
0701      * @see #array(byte[])
0702      * @see #array(char[])
0703      * @see #array(short[])
0704      * @see #array(long[])
0705      * @see #array(float[])
0706      * @see #array(double[])
0707      * @see Js#array(int[])
0708      * @see js.core.JsArray#JsArray(int[])
0709      * @see js.core.JsArray#JsArray(js.core.JsObject)
0710      * @see js.core.JsGlobal.Array#create(Object)
0711      * @since 1.0
0712      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0713      */
0714     protected abstract ArrayLike<Integer>   array(int    [] a);
0715     /**
0716      * <p>Gets the array-like representation of a long array.</p>
0717      * @param a A long array
0718      * @return The array-like representation.
0719      * @see #array(Object[])
0720      * @see #array(boolean[])
0721      * @see #array(byte[])
0722      * @see #array(char[])
0723      * @see #array(short[])
0724      * @see #array(int[])
0725      * @see #array(float[])
0726      * @see #array(double[])
0727      * @see Js#array(long[])
0728      * @see js.core.JsArray#JsArray(long[])
0729      * @see js.core.JsArray#JsArray(js.core.JsObject)
0730      * @see js.core.JsGlobal.Array#create(Object)
0731      * @since 1.0
0732      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0733      */
0734     protected abstract ArrayLike<Long>      array(long   [] a);
0735     /**
0736      * <p>Gets the array-like representation of a float array.</p>
0737      * @param a A float array
0738      * @return The array-like representation.
0739      * @see #array(Object[])
0740      * @see #array(boolean[])
0741      * @see #array(byte[])
0742      * @see #array(char[])
0743      * @see #array(short[])
0744      * @see #array(int[])
0745      * @see #array(long[])
0746      * @see #array(double[])
0747      * @see Js#array(float[])
0748      * @see js.core.JsArray#JsArray(float[])
0749      * @see js.core.JsArray#JsArray(js.core.JsObject)
0750      * @see js.core.JsGlobal.Array#create(Object)
0751      * @since 1.0
0752      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0753      */
0754     protected abstract ArrayLike<Float>     array(float  [] a);
0755     /**
0756      * <p>Gets the array-like representation of a double array.</p>
0757      * @param a A double array
0758      * @return The array-like representation.
0759      * @see #array(Object[])
0760      * @see #array(boolean[])
0761      * @see #array(byte[])
0762      * @see #array(char[])
0763      * @see #array(short[])
0764      * @see #array(int[])
0765      * @see #array(long[])
0766      * @see #array(float[])
0767      * @see Js#array(double[])
0768      * @see js.core.JsArray#JsArray(double[])
0769      * @see js.core.JsArray#JsArray(js.core.JsObject)
0770      * @see js.core.JsGlobal.Array#create(Object)
0771      * @since 1.0
0772      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0773      */
0774     protected abstract ArrayLike<Double>    array(double [] a);
0775     /**
0776      * <p>Creates a date object set to the current system date and time.</p>
0777      * @return The newly created date object.
0778      * @see #date(Number)
0779      * @see #date(String)
0780      * @see Js#date()
0781      * @see js.core.JsGlobal.Date#create()
0782      * @see js.core.JsGlobal.Date#create(Vars)
0783      * @since 1.0
0784      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0785      */
0786     protected abstract DateLike date();
0787     /**
0788      * <p>Creates a date object from a numeric representation in milliseconds.</p>
0789      * @param n A numeric representation of date in milliseconds.
0790      * @return The newly created date object.
0791      * @see #date()
0792      * @see #date(String)
0793      * @see Js#date(Number)
0794      * @see js.core.JsDate#JsDate(Number)
0795      * @see js.core.JsDate#JsDate(NumberLike)
0796      * @see js.core.JsGlobal.Date#create(Number)
0797      * @see js.core.JsGlobal.Date#create(NumberLike)
0798      * @see js.core.JsGlobal.Date#create(Vars)
0799      * @since 1.0
0800      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0801      */
0802     protected abstract DateLike date(Number n);
0803     /**
0804      * <p>Creates a date object from a string representation.</p>
0805      * @param s A string representation of date.
0806      * @return The newly created date object.
0807      * @see #date()
0808      * @see #date(Number)
0809      * @see Js#date(String)
0810      * @see js.core.JsDate#JsDate(String)
0811      * @see js.core.JsDate#JsDate(StringLike)
0812      * @see js.core.JsGlobal.Date#create(Object)
0813      * @see js.core.JsGlobal.Date#create(Vars)
0814      * @since 1.0
0815      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0816      */
0817     protected abstract DateLike date(String s);
0818     /**
0819      * <p>Returns the math-like object.</p>
0820      * @return The math-like object.
0821      * @see Js#math()
0822      * @see js.core.JsGlobal.Math
0823      * @see jsx.core.Maths
0824      * @since 1.0
0825      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0826      */
0827     protected abstract MathLike math();
0828     /**
0829      * <p>Creates and returns a newly created object.</p>
0830      * @return The newly created object.
0831      * @see #object(Object)
0832      * @see Js#object()
0833      * @see Initializer#var()
0834      * @see js.core.JsObject#JsObject()
0835      * @see js.core.JsGlobal.Object#create()
0836      * @see js.core.JsGlobal.Object#invoke()
0837      * @since 1.0
0838      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0839      */
0840     protected abstract ObjectLike object();
0841     /**
0842      * <p>Converts a value to an object and returns it.</p>
0843      * @param o A value to be converted to object. If this argument is a primitive value, 
0844      * this method creates a corresponding object for it. Otherwise, the method returns 
0845      * the object itself.
0846      * @return The converted or created object. If the argument is a primitive value, 
0847      * this method returns a corresponding object for it. Otherwise, the method returns 
0848      * the object argument itself.
0849      * @see #object()
0850      * @see Js#object(Object)
0851      * @see js.core.JsObject#JsObject(JsObject)
0852      * @see js.core.JsGlobal.Object#create(Boolean)
0853      * @see js.core.JsGlobal.Object#create(JsBoolean)
0854      * @see js.core.JsGlobal.Object#create(Value)
0855      * @see js.core.JsGlobal.Object#create(Number)
0856      * @see js.core.JsGlobal.Object#create(NumberLike)
0857      * @see js.core.JsGlobal.Object#create(String)
0858      * @see js.core.JsGlobal.Object#create(StringLike)
0859      * @see js.core.JsGlobal.Object#invoke(Boolean)
0860      * @see js.core.JsGlobal.Object#invoke(JsBoolean)
0861      * @see js.core.JsGlobal.Object#invoke(Value)
0862      * @see js.core.JsGlobal.Object#invoke(Number)
0863      * @see js.core.JsGlobal.Object#invoke(NumberLike)
0864      * @see js.core.JsGlobal.Object#invoke(String)
0865      * @see js.core.JsGlobal.Object#invoke(StringLike)
0866      * @since 1.0
0867      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0868      */
0869     protected abstract ObjectLike object(Object o);
0870     /**
0871      * <p>Creates a regular expression with the specified pattern.</p>
0872      * @param regex A string that specifies the pattern of the regular expression.
0873      * @return A new regular expression object, with the specified pattern.
0874      * @throws RuntimeException JavaScript throws a <tt>SyntaxError</tt> If <tt>regex</tt> 
0875      * is not a legal regular expression. See {@link Js#err(Object)} and {@link js.core.JsSyntaxError} 
0876      * for JS Simulation.
0877      * @see #re(String, String)
0878      * @see Js#re(String)
0879      * @see js.core.JsRegExp#JsRegExp(String)
0880      * @see js.core.JsGlobal.RegExp#create(Object)
0881      * @see js.core.JsGlobal.RegExp#create(Vars)
0882      * @see js.core.JsGlobal.RegExp#invoke(Object)
0883      * @see js.core.JsGlobal.RegExp#invoke(Vars)
0884      * @since 1.0
0885      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0886      */
0887     protected abstract RegExpLike re(String regex);
0888     /**
0889      * <p>Creates a regular expression with the specified pattern and flags.</p>
0890      * @param regex A string that specifies the pattern of the regular expression.
0891      * @param flags An optional string containing any of the "g", "i", and "m" attributes 
0892      * that specify global, case-insensitive, and multiline matches, respectively. The "m" 
0893      * attribute is not available prior to ECMAScript standardization.
0894      * @return A new regular expression object, with the specified pattern and flags.
0895      * @throws RuntimeException JavaScript throws a <tt>SyntaxError</tt> If <tt>regex</tt> 
0896      * is not a legal regular expression, or if <tt>flags</tt> contains characters other than 
0897      * "g", "i", and "m". See {@link Js#err(Object)} and {@link js.core.JsSyntaxError} for 
0898      * JS Simulation.
0899      * @see #re(String)
0900      * @see Js#re(String, String)
0901      * @see js.core.JsRegExp#JsRegExp(String, String)
0902      * @see js.core.JsGlobal.RegExp#create(Object, Object)
0903      * @see js.core.JsGlobal.RegExp#create(Vars)
0904      * @see js.core.JsGlobal.RegExp#invoke(Object, Object)
0905      * @see js.core.JsGlobal.RegExp#invoke(Vars)
0906      * @since 1.0
0907      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0908      */
0909     protected abstract RegExpLike re(String regex, String flags);
0910     /**
0911      * <p>Gets the hash code of a value.</p>
0912      * @param o Any value.
0913      * @return The hash code of a value.
0914      * @since 1.0
0915      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0916      */
0917     protected abstract int hashCode(Object o);
0918     /**
0919      * <p>Checks if a value equals another object.</p>
0920      * @param v Any value
0921      * @param o Any value
0922      * @return <tt>true</tt> if <tt>v</tt> equals <tt>o</tt>; false, otherwise.
0923      * @since 1.0
0924      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0925      */
0926     protected abstract boolean equals(Object v, Object o);
0927 
0928     /**
0929      * <p>Returns an instance of XMLHttpRequest in Java version.</p>
0930      * @return The instance of XMLHttpRequest in Java version.
0931      * @see js.dom.DOM.XMLHttpRequest#create()
0932      * @see js.dom.DOM.XMLHttpRequest#invoke()
0933      * @see jsx.http.Http#create()
0934      * @see jsx.http.Http#create2()
0935      * @since 1.0
0936      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0937      */
0938     protected abstract JsXMLHttpRequest http();
0939     /**
0940      * <p>Creates an OLE Automation (ActiveX) object for Internet Explorer.</p>
0941      * @param cls The class of the OLE Automation (ActiveX) object being created.
0942      * @return The newly created OLE Automation (ActiveX) object.
0943      * @see js.dom.DOM.ActiveXObject#create(Object)
0944      * @see js.dom.DOM.ActiveXObject#create(String)
0945      * @see js.dom.DOM.ActiveXObject#create(Vars)
0946      * @see jsx.http.Http#create()
0947      * @see jsx.http.Http#create2()
0948      * @since 1.0
0949      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0950      */
0951     protected abstract JsObject activeX(String cls);
0952     /**
0953      * <p>Connects to a Java class in an applet and returns a LiveConnect class.</p>
0954      * @param applet The applet ID where the Java class is to be connected to.
0955      * @param cls The Java class to be connected to.
0956      * @return The LiveConnect class connected to the Java class.
0957      * @see #connect(Object)
0958      * @see Js#connect(String, String)
0959      * @since 1.0
0960      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0961      */
0962     protected abstract LiveClass connect(String applet, String cls);
0963     /**
0964      * <p>Connects to a Java object and returns a LiveConnect object.</p>
0965      * @param obj The Java object to be connected to.
0966      * @return The LiveConnect object connected to the Java object.
0967      * @see #connect(String, String)
0968      * @see Js#connect(Object)
0969      * @since 1.0
0970      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0971      */
0972     protected abstract LiveObject connect(Object obj);
0973 
0974     /**
0975      * <p>Checks if a variable represents a Java object.</p>
0976      * @param v Any value or object.
0977      * @return <tt>true</tt> if <tt>v</tt> is Java; <tt>false</tt>, otherwise.
0978      * @since 1.0
0979      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0980      */
0981     protected abstract boolean isJavaObject(Object v);
0982 
0983     /**
0984      * <p>Gets the number representation of the argument if it is numeric.</p>
0985      * @param var Any variable
0986      * @return the number representation of the argument.
0987      * @since 1.0
0988      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0989      */
0990     protected abstract Number getNumber(Object var);
0991     /**
0992      * <p>Performs unary negation, resembling the unary minus operator in JavaScript.</p>
0993      * <p>This operation converts a positive value to an equivalently negative value, and 
0994      * vice versa. If the operand is not a number, it attempts to convert it to one.</p>
0995      * @param var Any numeric value.
0996      * @return The negation of the numeric value.
0997      * @since 1.0
0998      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
0999      */
1000     protected abstract Number neg(Number var);
1001     /**
1002      * <p>Adds numeric operands, resembling the addition operator in JavaScript.</p>
1003      * <p>Object operands are converted to numbers. The conversion is performed by the 
1004      * {@link Js#valueOf(Object)} operation on the object.</p>
1005      * @param var Any numeric value.
1006      * @param other Any numeric value.
1007      * @return The sum of the two numeric values.
1008      * @since 1.0
1009      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1010      */
1011     protected abstract Number add(Number var, Number other);
1012     /**
1013      * <p>Computes the first operand modulo the second operand, resembling the modulo 
1014      * operator in JavaScript.</p>
1015      * <p>The operation returns the remainder when the first operand is divided by the 
1016      * second operand a certain number of times. If used with non-numeric operands, the 
1017      * operation attempts to convert them to numbers. The sign of the result is the same 
1018      * as the sign of the first operand.</p>
1019      * <p>This operation is typically used with integer operands, it also works for 
1020      * floating-point values.</p>
1021      * @param var Any numeric value.
1022      * @param other Any numeric value.
1023      * @return The remainder.
1024      * @since 1.0
1025      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1026      */
1027     protected abstract Number mod(Number var, Number other);
1028     /**
1029      * <p>Multiplies the two operands, resembling the multiplication operator in JavaScript.</p>
1030      * <p>If used with non-numeric operands, this operation attempts to convert them to 
1031      * numbers.</p>
1032      * @param var Any numeric value.
1033      * @param other Any numeric value.
1034      * @return The product of the two operands.
1035      * @since 1.0
1036      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1037      */
1038     protected abstract Number mul(Number var, Number other);
1039     /**
1040      * <p>Divides the first operand by the second, resembling the multiplication operator 
1041      * in JavaScript.</p>
1042      * <p>Used with non-numeric operands, this operation attempts to convert them to 
1043      * numbers. If you are used to programming languages that distinguish between integer 
1044      * and floating-point numbers, you might expect to get an integer result when you 
1045      * divide one integer by another. In JavaScript, however, all numbers are floating-point, 
1046      * so all division operations have floating-point results. Division by zero yields positive 
1047      * or negative infinity, while <tt>0/0</tt> evaluates to <tt>NaN</tt>.</p>
1048      * @param var Any numeric value.
1049      * @param other Any numeric value.
1050      * @return The quotient of the two operands.
1051      * @since 1.0
1052      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1053      */
1054     protected abstract Number div(Number var, Number other);
1055     /**
1056      * <p>Checks if the first operand is the name of a property of the second, resembling 
1057      * the <tt>in</tt> operator in JavaScript.</p>
1058      * <p>This operation converts the first operand to a string and expects the second 
1059      * operand be an object (or array).</p>
1060      * @param v Any value that is or can be converted to a string.
1061      * @param o Any object or array.
1062      * @return <tt>true</tt> if the first operand is the name of a property of the 
1063      * second operand; <tt>false</tt>, otherwise;
1064      * @since 1.0
1065      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1066      */
1067     protected abstract boolean in(Object v, Object o);
1068     /**
1069      * <p>Checks if the first operand is an instance of the second, resembling the 
1070      * <tt>instanceof</tt> operator in JavaScript.</p>
1071      * <p>This operation expects the first operand be an object and the second be a class 
1072      * of objects. In JavaScript, classes of objects are defined by the constructor function 
1073      * that initializes them.</p>
1074      * @param v Any value or object.
1075      * @param o A constructor function.
1076      * @return <tt>true</tt> if the first operand is an instance of the second; 
1077      * <tt>false</tt>, otherwise;
1078      * @since 1.0
1079      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1080      */
1081     protected abstract boolean instanceOf(Object v, Object o);
1082     /**
1083      * <p>Less-than operation, resembling that of JavaScript, evaluates to <tt>true</tt> if 
1084      * the first operand is less than the second operand; otherwise it evaluates to 
1085      * <tt>false</tt>.</p>
1086      * <p>The operands of this operation may be of any type. Comparison can be performed 
1087      * only on numbers and strings, however, so operands that are not numbers or strings 
1088      * are converted. Comparison and conversion occur as follows:</p>
1089      * <ul>
1090      * <li>If both operands are numbers, or if both convert to numbers, they are compared 
1091      * numerically.</li>
1092      * <li>If both operands are strings or convert to strings, they are compared as 
1093      * strings.</li>
1094      * <li>If one operand is or converts to a string, and one is or converts to a number, 
1095      * the operation attempts to convert the string to a number and performs a numerical 
1096      * comparison. If the string does not represent a number, it converts to <tt>NaN</tt>, 
1097      * and the comparison is <tt>false</tt>. In JavaScript 1.1, the string-to-number 
1098      * conversion causes an error instead of yielding <tt>NaN</tt>.</li>
1099      * <li>If an object can be converted to either a number or a string, JavaScript performs 
1100      * the numerical conversion. This means, for example, that Date objects are compared 
1101      * numerically, and it is meaningful to compare two dates to see whether one is earlier 
1102      * than the other.</li>
1103      * <li>If the operands of the comparison operations cannot both be successfully converted 
1104      * to numbers or to strings, these operations always return <tt>false</tt>.</li>
1105      * <li>If either operand is or converts to <tt>NaN</tt>, the comparison operation always 
1106      * yields <tt>false</tt>.</li>
1107      * </ul>
1108      * <p>Keep in mind that string comparison is done on a strict character-by-character 
1109      * basis using the numerical value of each character from the Unicode encoding. Although 
1110      * in some cases the Unicode standard allows equivalent strings to be encoded using 
1111      * different sequences of characters, the JavaScript comparison operations do not 
1112      * detect these encoding differences; they assume that all strings are expressed in 
1113      * normalized form. Note in particular that string comparison is case-sensitive, and 
1114      * in the Unicode encoding (at least for the ASCII subset), all capital letters are 
1115      * "less than" all lowercase letters. This rule can cause confusing results if you do 
1116      * not expect it.</p>
1117      * <p>For a more robust string-comparison algorithm, see the {@link StringLike#localeCompare(Object)} 
1118      * method, which also takes locale-specific definitions of alphabetical order into account. 
1119      * For case-insensitive comparisons, you must first convert the strings to all lowercase or 
1120      * all uppercase using {@link StringLike#toLowerCase()} or {@link StringLike#toUpperCase()}.</p>
1121      * <p>The less-than-or-equal and greater-than-or-equal operations do not rely on the 
1122      * equality or identity operations for determining whether two values are "equal." 
1123      * Instead, the less-than-or-equal operator is simply defined as "not greater than", 
1124      * and the greater-than-or-equal operator is defined as "not less than". The one 
1125      * exception occurs when either operand is (or converts to) <tt>NaN</tt>, in which case 
1126      * all comparison operations return <tt>false</tt>.</p>
1127      * @param var A value or object.
1128      * @param other A value or object.
1129      * @return <tt>true</tt> if the first operand is less than the second operand; 
1130      * otherwise <tt>false</tt>.
1131      * @since 1.0
1132      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1133      */
1134     protected abstract boolean lt(Object var, Object other);
1135     /**
1136      * <p>Greater-than operation, resembling that of JavaScript, evaluates to <tt>true</tt> if 
1137      * the first operand is greater than the second operand; otherwise it evaluates to 
1138      * <tt>false</tt>.</p>
1139      * <p>The operands of this operation may be of any type. Comparison can be performed 
1140      * only on numbers and strings, however, so operands that are not numbers or strings 
1141      * are converted. Comparison and conversion occur as follows:</p>
1142      * <ul>
1143      * <li>If both operands are numbers, or if both convert to numbers, they are compared 
1144      * numerically.</li>
1145      * <li>If both operands are strings or convert to strings, they are compared as 
1146      * strings.</li>
1147      * <li>If one operand is or converts to a string, and one is or converts to a number, 
1148      * the operation attempts to convert the string to a number and performs a numerical 
1149      * comparison. If the string does not represent a number, it converts to <tt>NaN</tt>, 
1150      * and the comparison is <tt>false</tt>. In JavaScript 1.1, the string-to-number 
1151      * conversion causes an error instead of yielding <tt>NaN</tt>.</li>
1152      * <li>If an object can be converted to either a number or a string, JavaScript performs 
1153      * the numerical conversion. This means, for example, that Date objects are compared 
1154      * numerically, and it is meaningful to compare two dates to see whether one is earlier 
1155      * than the other.</li>
1156      * <li>If the operands of the comparison operations cannot both be successfully converted 
1157      * to numbers or to strings, these operations always return <tt>false</tt>.</li>
1158      * <li>If either operand is or converts to <tt>NaN</tt>, the comparison operation always 
1159      * yields <tt>false</tt>.</li>
1160      * </ul>
1161      * <p>Keep in mind that string comparison is done on a strict character-by-character 
1162      * basis using the numerical value of each character from the Unicode encoding. Although 
1163      * in some cases the Unicode standard allows equivalent strings to be encoded using 
1164      * different sequences of characters, the JavaScript comparison operations do not 
1165      * detect these encoding differences; they assume that all strings are expressed in 
1166      * normalized form. Note in particular that string comparison is case-sensitive, and 
1167      * in the Unicode encoding (at least for the ASCII subset), all capital letters are 
1168      * "less than" all lowercase letters. This rule can cause confusing results if you do 
1169      * not expect it.</p>
1170      * <p>For a more robust string-comparison algorithm, see the {@link StringLike#localeCompare(Object)} 
1171      * method, which also takes locale-specific definitions of alphabetical order into account. 
1172      * For case-insensitive comparisons, you must first convert the strings to all lowercase or 
1173      * all uppercase using {@link StringLike#toLowerCase()} or {@link StringLike#toUpperCase()}.</p>
1174      * <p>The less-than-or-equal and greater-than-or-equal operations do not rely on the 
1175      * equality or identity operations for determining whether two values are "equal." 
1176      * Instead, the less-than-or-equal operator is simply defined as "not greater than", 
1177      * and the greater-than-or-equal operator is defined as "not less than". The one 
1178      * exception occurs when either operand is (or converts to) <tt>NaN</tt>, in which case 
1179      * all comparison operations return <tt>false</tt>.</p>
1180      * @param var A value or object.
1181      * @param other A value or object.
1182      * @return <tt>true</tt> if the first operand is greater than the second operand; 
1183      * otherwise <tt>false</tt>.
1184      * @since 1.0
1185      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1186      */
1187     protected abstract boolean gt(Object var, Object other);
1188     /**
1189      * <p>Less-than-or-equal operation, resembling that of JavaScript, evaluates to 
1190      * <tt>true</tt> if the first operand is less than or equal to the second operand; 
1191      * otherwise it evaluates to <tt>false</tt>.</p>
1192      * <p>The operands of this operation may be of any type. Comparison can be performed 
1193      * only on numbers and strings, however, so operands that are not numbers or strings 
1194      * are converted. Comparison and conversion occur as follows:</p>
1195      * <ul>
1196      * <li>If both operands are numbers, or if both convert to numbers, they are compared 
1197      * numerically.</li>
1198      * <li>If both operands are strings or convert to strings, they are compared as 
1199      * strings.</li>
1200      * <li>If one operand is or converts to a string, and one is or converts to a number, 
1201      * the operation attempts to convert the string to a number and performs a numerical 
1202      * comparison. If the string does not represent a number, it converts to <tt>NaN</tt>, 
1203      * and the comparison is <tt>false</tt>. In JavaScript 1.1, the string-to-number 
1204      * conversion causes an error instead of yielding <tt>NaN</tt>.</li>
1205      * <li>If an object can be converted to either a number or a string, JavaScript performs 
1206      * the numerical conversion. This means, for example, that Date objects are compared 
1207      * numerically, and it is meaningful to compare two dates to see whether one is earlier 
1208      * than the other.</li>
1209      * <li>If the operands of the comparison operations cannot both be successfully converted 
1210      * to numbers or to strings, these operations always return <tt>false</tt>.</li>
1211      * <li>If either operand is or converts to <tt>NaN</tt>, the comparison operation always 
1212      * yields <tt>false</tt>.</li>
1213      * </ul>
1214      * <p>Keep in mind that string comparison is done on a strict character-by-character 
1215      * basis using the numerical value of each character from the Unicode encoding. Although 
1216      * in some cases the Unicode standard allows equivalent strings to be encoded using 
1217      * different sequences of characters, the JavaScript comparison operations do not 
1218      * detect these encoding differences; they assume that all strings are expressed in 
1219      * normalized form. Note in particular that string comparison is case-sensitive, and 
1220      * in the Unicode encoding (at least for the ASCII subset), all capital letters are 
1221      * "less than" all lowercase letters. This rule can cause confusing results if you do 
1222      * not expect it.</p>
1223      * <p>For a more robust string-comparison algorithm, see the {@link StringLike#localeCompare(Object)} 
1224      * method, which also takes locale-specific definitions of alphabetical order into account. 
1225      * For case-insensitive comparisons, you must first convert the strings to all lowercase or 
1226      * all uppercase using {@link StringLike#toLowerCase()} or {@link StringLike#toUpperCase()}.</p>
1227      * <p>The less-than-or-equal and greater-than-or-equal operations do not rely on the 
1228      * equality or identity operations for determining whether two values are "equal." 
1229      * Instead, the less-than-or-equal operator is simply defined as "not greater than", 
1230      * and the greater-than-or-equal operator is defined as "not less than". The one 
1231      * exception occurs when either operand is (or converts to) <tt>NaN</tt>, in which case 
1232      * all comparison operations return <tt>false</tt>.</p>
1233      * @param var A value or object.
1234      * @param other A value or object.
1235      * @return <tt>true</tt> if the first operand is less than or equal to the second 
1236      * operand; otherwise <tt>false</tt>.
1237      * @since 1.0
1238      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1239      */
1240     protected abstract boolean lte(Object var, Object other);
1241     /**
1242      * <p>Greater-than-or-equal operation, resembling that of JavaScript, evaluates to 
1243      * <tt>true</tt> if the first operand is greater than or equal to the second operand; 
1244      * otherwise it evaluates to <tt>false</tt>.</p>
1245      * <p>The operands of this operation may be of any type. Comparison can be performed 
1246      * only on numbers and strings, however, so operands that are not numbers or strings 
1247      * are converted. Comparison and conversion occur as follows:</p>
1248      * <ul>
1249      * <li>If both operands are numbers, or if both convert to numbers, they are compared 
1250      * numerically.</li>
1251      * <li>If both operands are strings or convert to strings, they are compared as 
1252      * strings.</li>
1253      * <li>If one operand is or converts to a string, and one is or converts to a number, 
1254      * the operation attempts to convert the string to a number and performs a numerical 
1255      * comparison. If the string does not represent a number, it converts to <tt>NaN</tt>, 
1256      * and the comparison is <tt>false</tt>. In JavaScript 1.1, the string-to-number 
1257      * conversion causes an error instead of yielding <tt>NaN</tt>.</li>
1258      * <li>If an object can be converted to either a number or a string, JavaScript performs 
1259      * the numerical conversion. This means, for example, that Date objects are compared 
1260      * numerically, and it is meaningful to compare two dates to see whether one is earlier 
1261      * than the other.</li>
1262      * <li>If the operands of the comparison operations cannot both be successfully converted 
1263      * to numbers or to strings, these operations always return <tt>false</tt>.</li>
1264      * <li>If either operand is or converts to <tt>NaN</tt>, the comparison operation always 
1265      * yields <tt>false</tt>.</li>
1266      * </ul>
1267      * <p>Keep in mind that string comparison is done on a strict character-by-character 
1268      * basis using the numerical value of each character from the Unicode encoding. Although 
1269      * in some cases the Unicode standard allows equivalent strings to be encoded using 
1270      * different sequences of characters, the JavaScript comparison operations do not 
1271      * detect these encoding differences; they assume that all strings are expressed in 
1272      * normalized form. Note in particular that string comparison is case-sensitive, and 
1273      * in the Unicode encoding (at least for the ASCII subset), all capital letters are 
1274      * "less than" all lowercase letters. This rule can cause confusing results if you do 
1275      * not expect it.</p>
1276      * <p>For a more robust string-comparison algorithm, see the {@link StringLike#localeCompare(Object)} 
1277      * method, which also takes locale-specific definitions of alphabetical order into account. 
1278      * For case-insensitive comparisons, you must first convert the strings to all lowercase or 
1279      * all uppercase using {@link StringLike#toLowerCase()} or {@link StringLike#toUpperCase()}.</p>
1280      * <p>The less-than-or-equal and greater-than-or-equal operations do not rely on the 
1281      * equality or identity operations for determining whether two values are "equal." 
1282      * Instead, the less-than-or-equal operator is simply defined as "not greater than", 
1283      * and the greater-than-or-equal operator is defined as "not less than". The one 
1284      * exception occurs when either operand is (or converts to) <tt>NaN</tt>, in which case 
1285      * all comparison operations return <tt>false</tt>.</p>
1286      * @param var A value or object.
1287      * @param other A value or object.
1288      * @return <tt>true</tt> if the first operand is greater than or equal to the second 
1289      * operand; otherwise <tt>false</tt>.
1290      * @since 1.0
1291      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1292      */
1293     protected abstract boolean gte(Object var, Object other);
1294     /**
1295      * <p>Checks whether the two operands are "equal" using a more relaxed definition of 
1296      * sameness that allows type conversions, resembling the equality operator in 
1297      * JavaScript.</p>
1298      * <p>The equality and identity operations check whether two values are the same, using 
1299      * two different definitions of sameness. Both operations accept operands of any type, 
1300      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1301      * if they are different. The identity operation checks whether its two operands are 
1302      * "identical" using a strict definition of sameness. The equality operation checks 
1303      * whether its two operands are "equal" using a more relaxed definition of sameness 
1304      * that allows type conversions.</p>
1305      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1306      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1307      * assignment, equality, and identity operations, and be careful to use the correct one 
1308      * when coding! Although it is tempting to call all three operations "equals," it may 
1309      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1310      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1311      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1312      * case, two separate values are involved, and the equality and identity operations 
1313      * check that these two values are identical. This means that two variables are equal 
1314      * or identical only if they contain the same value. For example, two strings are equal 
1315      * only if they each contain exactly the same characters.</p>
1316      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1317      * means that two variables are equal only if they refer to the same object. Two 
1318      * separate arrays are never equal or identical, even if they contain equal or identical 
1319      * elements. Two variables that contain references to objects, arrays, or functions are 
1320      * equal only if they refer to the same object, array, or function. If you want to test 
1321      * that two distinct objects contain the same properties or that two distinct arrays 
1322      * contain the same elements, you'll have to check the properties or elements individually 
1323      * for equality or identity. And, if any of the properties or elements are themselves 
1324      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1325      * <p>The following rules determine whether two values are equal according to the 
1326      * equality operation:
1327      * <ul>
1328      * <li>If the two values have the same type, test them for identity. If the values are 
1329      * identical, they are equal; if they are not identical, they are not equal.</li>
1330      * <li>If the two values do not have the same type, they may still be equal. Use the 
1331      * following rules and type conversions to check for equality:</li>
1332      * <ul>
1333      * <li>If one value is null and the other is undefined, they are equal.</li>
1334      * <li>If one value is a number and the other is a string, convert the string to a 
1335      * number and try the comparison again, using the converted value.</li>
1336      * <li>If either value is <tt>true</tt>, convert it to 1 and try the comparison 
1337      * again. If either value is <tt>false</tt>, convert it to 0 and try the comparison 
1338      * again.</li>
1339      * <li>If one value is an object and the other is a number or string, convert the 
1340      * object to a primitive and try the comparison again. An object is converted to a 
1341      * primitive value by either its <tt>toString()</tt> method or its <tt>valueOf()</tt> 
1342      * method. The built-in classes of core JavaScript attempt <tt>valueOf()</tt> 
1343      * conversion before <tt>toString()</tt> conversion, except for the Date class, 
1344      * which performs <tt>toString()</tt> conversion. Objects that are not part of core 
1345      * JavaScript may convert themselves to primitive values in an implementation-defined 
1346      * way.</li>
1347      * <li>Any other combinations of values are not equal.</li>
1348      * </ul>
1349      * </ul>
1350      * @param v Any value or object.
1351      * @param o Any value or object.
1352      * @return <tt>true</tt> if the first operand equals the second; <tt>false</tt>, 
1353      * otherwise;
1354      * @since 1.0
1355      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1356      */
1357     protected abstract boolean eq (Object v, Object o);
1358     /**
1359      * <p>Checks whether the two operands are "identical" using a strict definition of 
1360      * sameness, resembling the identity operator in JavaScript.</p>
1361      * <p>The equality and identity operations check whether two values are the same, using 
1362      * two different definitions of sameness. Both operations accept operands of any type, 
1363      * and both return <tt>true</tt> if their operands are the same and <tt>false</tt> 
1364      * if they are different. The identity operation checks whether its two operands are 
1365      * "identical" using a strict definition of sameness. The equality operation checks 
1366      * whether its two operands are "equal" using a more relaxed definition of sameness 
1367      * that allows type conversions.</p>
1368      * <p>The identity operation is standardized by ECMAScript v3 and implemented in 
1369      * JavaScript 1.3 and later. Be sure you understand the differences between the 
1370      * assignment, equality, and identity operations, and be careful to use the correct one 
1371      * when coding! Although it is tempting to call all three operations "equals," it may 
1372      * help to reduce confusion if you read "gets or is assigned" for assignment operation, 
1373      * "is equal to" for equality operation, and "is identical to" for identity operation.</p>
1374      * <p>In JavaScript, numbers, strings, and boolean values are compared by value. In this 
1375      * case, two separate values are involved, and the equality and identity operations 
1376      * check that these two values are identical. This means that two variables are equal 
1377      * or identical only if they contain the same value. For example, two strings are equal 
1378      * only if they each contain exactly the same characters.</p>
1379      * <p>On the other hand, objects, arrays, and functions are compared by reference. This 
1380      * means that two variables are equal only if they refer to the same object. Two 
1381      * separate arrays are never equal or identical, even if they contain equal or identical 
1382      * elements. Two variables that contain references to objects, arrays, or functions are 
1383      * equal only if they refer to the same object, array, or function. If you want to test 
1384      * that two distinct objects contain the same properties or that two distinct arrays 
1385      * contain the same elements, you'll have to check the properties or elements individually 
1386      * for equality or identity. And, if any of the properties or elements are themselves 
1387      * objects or arrays, you'll have to decide how deep you want the comparison to go.</p>
1388      * <p>The following rules determine whether two values are identical according to the identity operation:
1389      * <ul>
1390      * <li>If the two values have different types, they are not identical.</li>
1391      * <li>If both values are numbers and have the same value, they are identical, unless 
1392      * either or both values are <tt>NaN</tt>, in which case they are not identical. 
1393      * The <tt>NaN</tt> value is never identical to any other value, including itself! 
1394      * To check whether a value is <tt>NaN</tt>, use the global {@link Js#isNaN(Object)} 
1395      * function.</li>
1396      * <li>If both values are strings and contain exactly the same characters in the same 
1397      * positions, they are identical. If the strings differ in length or content, they are 
1398      * not identical. Note that in some cases, the Unicode standard allows more than one 
1399      * way to encode the same string. For efficiency, however, JavaScript's string 
1400      * comparison compares strictly on a character-by-character basis, and it assumes that 
1401      * all strings have been converted to a "normalized form" before they are compared. 
1402      * See the {@link StringLike#localeCompare(Object)} for another way to compare strings.</li>
1403      * <li>If both values are the boolean value <tt>true</tt> or both are the boolean 
1404      * value <tt>false</tt>, they are identical.</li>
1405      * <li>If both values refer to the same object, array, or function, they are identical. 
1406      * If they refer to different objects (or arrays or functions) they are not identical, 
1407      * even if both objects have identical properties or both arrays have identical elements.</li>
1408      * <li>If both values are null or both values are undefined, they are identical.</li>
1409      * </ul>
1410      * @param v Any value or object.
1411      * @param o Any value or object.
1412      * @return <tt>true</tt> if the first operand is identical to the second; 
1413      * <tt>false</tt>, otherwise;
1414      * @since 1.0
1415      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1416      */
1417     protected abstract boolean eqs(Object v, Object o);
1418 
1419     /**
1420      * <p>Converts a numeric value to a number object and returns it.</p>
1421      * @param n A numeric value to be converted to number object.
1422      * @return The number object.
1423      * @see js.core.JsNumber#JsNumber(Number)
1424      * @see js.core.JsNumber#JsNumber(Value)
1425      * @see js.core.JsGlobal.Number#create(Object)
1426      * @see js.core.JsGlobal.Number#create(Vars)
1427      * @see js.core.JsGlobal.Number#invoke(Object)
1428      * @see js.core.JsGlobal.Number#invoke(Vars)
1429      * @since 1.0
1430      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1431      */
1432     protected abstract <T extends Number> NumberLike<T> numberLike(T n);
1433     /**
1434      * <p>Converts a string value to a string object and returns it.</p>
1435      * @param s A string value to be converted to string object.
1436      * @return The string object.
1437      * @see js.core.JsString#JsString(String)
1438      * @see js.core.JsString#JsString(Var)
1439      * @see js.core.JsGlobal.String#create(Object)
1440      * @see js.core.JsGlobal.String#create(Vars)
1441      * @see js.core.JsGlobal.String#invoke(Object)
1442      * @see js.core.JsGlobal.String#invoke(Vars)
1443      * @since 1.0
1444      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1445      */
1446     protected abstract StringLike stringLike(String s);
1447 
1448     /**
1449      * <p>Internally creates function object from a function definition.</p>
1450      * @param f A {@link Function} definition.
1451      * @return The function object.
1452      * @since 1.0
1453      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1454      */
1455     protected abstract <T> JsFunction<T> var(Function<T> f);
1456     /**
1457      * <p>Internally creates a variable list from a value or object.</p>
1458      * @param args A value or object.
1459      * @return The variable list created.
1460      * @since 1.0
1461      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1462      */
1463     protected abstract Vars<?> vars(Object args);
1464 
1465     /**
1466      * <p>Internally down cast an object to array type.</p>
1467      * <p>This method is internal and only called inside of opaque or internal classes 
1468      * or class members.</p>
1469      * @param o The object
1470      * @since 1.0
1471      * @return The array representation of an object
1472      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1473      */
1474     protected abstract JsArray toJsArray(JsObject o);
1475     /**
1476      * <p>Internally down cast an object to boolean type.</p>
1477      * <p>This method is internal and only called inside of opaque or internal classes 
1478      * or class members.</p>
1479      * @param o The object
1480      * @since 1.0
1481      * @return The boolean representation of an object
1482      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1483      */
1484     protected abstract JsBoolean toJsBoolean(JsObject o);
1485     /**
1486      * <p>Internally down cast an object to date type.</p>
1487      * <p>This method is internal and only called inside of opaque or internal classes 
1488      * or class members.</p>
1489      * @param o The object
1490      * @since 1.0
1491      * @return The date representation of an object
1492      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1493      */
1494     protected abstract JsDate toJsDate(JsObject o);
1495     /**
1496      * <p>Internally down cast an object to function type.</p>
1497      * <p>This method is internal and only called inside of opaque or internal classes 
1498      * or class members.</p>
1499      * @param o The object
1500      * @since 1.0
1501      * @return The function representation of an object
1502      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1503      */
1504     protected abstract <T> JsFunction<T> toJsFunction(JsObject o);
1505     /**
1506      * <p>Internally down cast an object to function type.</p>
1507      * <p>This method is internal and only called inside of opaque or internal classes 
1508      * or class members.</p>
1509      * @param o The object
1510      * @param w A wrapper to perform the cast
1511      * @since 1.0
1512      * @return The function representation of an object
1513      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1514      */
1515     protected abstract <T> JsFunction<T> toJsFunction(JsObject o, Generic<T> w);
1516     /**
1517      * <p>Internally down cast an object to number type.</p>
1518      * <p>This method is internal and only called inside of opaque or internal classes 
1519      * or class members.</p>
1520      * @param o The object
1521      * @since 1.0
1522      * @return The number representation of an object
1523      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1524      */
1525     protected abstract JsNumber toJsNumber(JsObject o);
1526     /**
1527      * <p>Internally down cast an object to regular expression type.</p>
1528      * <p>This method is internal and only called inside of opaque or internal classes 
1529      * or class members.</p>
1530      * @param o The object
1531      * @since 1.0
1532      * @return The regular expression representation of an object
1533      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1534      */
1535     protected abstract JsRegExp toJsRegExp(JsObject o);
1536     /**
1537      * <p>Internally down cast an object to string type.</p>
1538      * <p>This method is internal and only called inside of opaque or internal classes 
1539      * or class members.</p>
1540      * @param o The object
1541      * @since 1.0
1542      * @return The string representation of an object
1543      * @javascript Re-compilers must report error on the invocation to an <b>internal</b> method. 
1544      */
1545     protected abstract JsString toJsString(JsObject o);
1546 }