001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js;
021 
022 import js.core.JsArray;
023 import js.core.JsFunction;
024 
025 /**
026  * <p>An <b>opaque</b> interface resembling JavaScript arrays.</p>
027  * <p>This interface must be implemented in JS Simulation Libraries.</p>
028  *
029  * @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>
030  * @see Vars#var()
031  * @see Js#array()
032  * @see Js#array(Object[])
033  * @see Js#array(boolean[])
034  * @see Js#array(byte[])
035  * @see Js#array(char[])
036  * @see Js#array(short[])
037  * @see Js#array(int[])
038  * @see Js#array(long[])
039  * @see Js#array(float[])
040  * @see Js#array(double[])
041  * @see js.core.JsArray#JsArray()
042  * @see js.core.JsArray#JsArray(js.core.JsObject)
043  * @see js.core.JsArray#JsArray(Object[])
044  * @see js.core.JsArray#JsArray(boolean[])
045  * @see js.core.JsArray#JsArray(byte[])
046  * @see js.core.JsArray#JsArray(char[])
047  * @see js.core.JsArray#JsArray(short[])
048  * @see js.core.JsArray#JsArray(int[])
049  * @see js.core.JsArray#JsArray(long[])
050  * @see js.core.JsArray#JsArray(float[])
051  * @see js.core.JsArray#JsArray(double[])
052  * @see js.core.JsGlobal.Array#create()
053  * @see js.core.JsGlobal.Array#create(Object)
054  * @see js.core.JsGlobal.Array#create(Vars)
055  * @see jsx.core.ArrayLikes
056  * 
057  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be 
058  * generated into the target codes. Re-compilers must exit with error on the operations of 
059  * accessing that kind of class objects.
060  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored 
061  * and <tt>instanceof</tt> to it always <tt>true</tt>.
062  */
063 
064 public interface ArrayLike<T> extends ArrayObject<T>
065 {
066     /**
067      * <p>Writes an element of the current array instance.</p>
068      * @param i Array index of the element
069      * @param v The new value
070      * @return The new value of the element
071      * @see ArrayObject#get(int)
072      * @since 1.0
073      * @javascript Re-compilers must convert the interface invocation of this method into the 
074      * JavaScript expression: 
075      * <pre>(a[i]=v)</pre>
076      * where <tt>a</tt> is the current array instance of the invocation.
077      */
078     public T set(int i, T v);
079     /**
080      * <p>Deletes an element of the current array instance.</p>
081      * @param i Array index of the element
082      * @return <tt>true</tt> if the deletion is successful, <tt>false</tt> otherwise.
083      * @see #set(int, Object)
084      * @see jsx.core.ArrayLikes#delete(ArrayLike, int)
085      * @since 1.0
086      * @javascript Re-compilers must convert the interface invocation of this method into the 
087      * JavaScript expression: 
088      * <pre>(delete a[i])</pre>
089      * where <tt>a</tt> is the current array instance of the invocation.
090      */
091     public boolean delete(int i);
092     /**
093      * <p>Changes the size of the current array instance.</p>
094      * @param len New size
095      * @return New size
096      * @see jsx.core.ArrayLikes#length(ArrayLike, int)
097      * @since 1.0
098      * @javascript Re-compilers must convert the interface invocation of this method into the 
099      * JavaScript expression: 
100      * <pre>(a.length=len)</pre>
101      * where <tt>a</tt> is the current array instance of the invocation.
102      */
103     public int length(int len);
104     /**
105      * <p>Gets the <tt>index</tt> field of the current array instance.</p>
106      * @return The value of the <tt>index</tt> field of an array object
107      * @see StringLike#match(RegExpLike)
108      * @see jsx.core.ArrayLikes#index(ArrayLike)
109      * @since 1.0
110      * @javascript Re-compilers must convert the interface invocation of this method into the 
111      * JavaScript expression: 
112      * <pre>a.index</pre>
113      * where <tt>a</tt> is the current array instance of the invocation.
114      */
115     public Integer index();
116     /**
117      * <p>Gets the <tt>input</tt> field of the current array instance.</p>
118      * @return The value of the <tt>input</tt> field of an array object
119      * @see StringLike#match(RegExpLike)
120      * @see RegExpLike#exec(Object)
121      * @see jsx.core.ArrayLikes#input(ArrayLike)
122      * @since 1.0
123      * @javascript Re-compilers must convert the interface invocation of this method into the 
124      * JavaScript expression: 
125      * <pre>a.input</pre>
126      * where <tt>a</tt> is the current array instance of the invocation.
127      */
128     public String input();
129     /**
130      * <p>Creates and returns a new array object that is the result of concatenating its
131      * argument to the current array instance. This invocation does not modify the current 
132      * array. If the argument to <tt>concat</tt> is itself an array, the elements of that array 
133      * are concatenated, rather than the array itself.</p>
134      * @param arg A value to be concatenated with the current array.
135      * @return A new array object, which is formed by concatenating the specified argument
136      * to the current array.
137      * @see #concat(Vars)
138      * @see jsx.core.ArrayLikes#concat(ArrayLike, Object)
139      * @since 1.0
140      * @javascript Re-compilers must convert the interface invocation of this method directly 
141      * into a JavaScript invocation on its current array instance without changing the 
142      * method name, but expanding variable arguments, if any, into comma-separated values. 
143      */
144     public ArrayLike<T> concat(Object arg);
145     /**
146      * <p>Creates and returns a new array object that is the result of concatenating each 
147      * of its arguments to the current array instance. This invocation does not modify the 
148      * current array. If any of the arguments to <tt>concat</tt> is itself an array, 
149      * the elements of that array are concatenated, rather than the array itself.</p>
150      * @param args A list of the argument values to be concatenated with the current array.
151      * @return A new array object, which is formed by concatenating each of the specified
152      * arguments to the current array.
153      * @see #concat(Object)
154      * @since 1.0
155      * @javascript Re-compilers must convert the interface invocation of this method directly 
156      * into a JavaScript invocation on its current array instance without changing the 
157      * method name, but expanding variable arguments, if any, into comma-separated values. 
158      */
159     public ArrayLike<T> concat(Vars<?> args);
160     /**
161      * <p>Converts each element of the current array instance to a string and then 
162      * concatenates those strings, inserting a comma between the elements and returns 
163      * the resulting string.</p>
164      * @return The string that results from converting each element of the current array
165      * to a string and then concatenating them together with a comma between elements.
166      * @see #join(Object)
167      * @see StringLike#split(Object)
168      * @see jsx.core.ArrayLikes#join(ArrayLike)
169      * @since 1.0
170      * @javascript Re-compilers must convert the interface invocation of this method directly 
171      * into a JavaScript invocation on its current array instance without changing the 
172      * method name, but expanding variable arguments, if any, into comma-separated values. 
173      */
174     public String join();
175     /**
176      * <p>Converts each element of the current array instance to a string and then 
177      * concatenates those strings, inserting the separator string specified by 
178      * <tt>separator</tt> between the elements and returns the resulting string.</p>
179      * @param separator An optional string used to separate one element of the current array
180      * from the next in the returned string. If this argument is omitted, 
181      * <tt>undefined</tt> or <tt>null</tt>, a comma is used.
182      * @return The string that results from converting each element of the current array
183      * to a string and then concatenating them together, with the <tt>separator</tt>
184      * string between elements.
185      * @see StringLike#split(Object)
186      * @see jsx.core.ArrayLikes#join(ArrayLike, Object)
187      * @since 1.0
188      * @javascript Re-compilers must convert the interface invocation of this method directly 
189      * into a JavaScript invocation on its current array instance without changing the 
190      * method name, but expanding variable arguments, if any, into comma-separated values. 
191      */
192     public String join(Object separator);
193     /**
194      * <p>Deletes the last element of the current array instance, decrements the length of 
195      * the current array, and returns the value of the deleted element. If the current array is 
196      * already empty, this invocation does not change the array and returns the undefined <tt>null</tt> value.</p>
197      * @return The last element of the current array.
198      * @see #push(Object)
199      * @see #push(Vars)
200      * @see jsx.core.ArrayLikes#pop(ArrayLike)
201      * @since 1.0
202      * @javascript Re-compilers must convert the interface invocation of this method directly 
203      * into a JavaScript invocation on its current array instance without changing the 
204      * method name, but expanding variable arguments, if any, into comma-separated values. 
205      */
206     public T pop();
207     /**
208      * <p>Appends the argument to the end of the current array instance by modifying the 
209      * array directly rather than creating a new one.</p>
210      * @param v A value to be appended to the end of the current array.
211      * @return The new length of the array, after the specified value are appended to it.
212      * @see #push(Vars)
213      * @see #pop()
214      * @see jsx.core.ArrayLikes#push(ArrayLike, Object)
215      * @since 1.0
216      * @javascript Re-compilers must convert the interface invocation of this method directly 
217      * into a JavaScript invocation on its current array instance without changing the 
218      * method name, but expanding variable arguments, if any, into comma-separated values. 
219      */
220     public int push(Object v);
221     /**
222      * <p>Appends the arguments, in order, to the end of the current array instance by 
223      * modifying the array directly rather than creating a new one.</p>
224      * @param args A list of the values to be appended to the end of the current array.
225      * @return The new length of the array, after the specified values are appended to it.
226      * @see #push(Object)
227      * @see #pop()
228      * @since 1.0
229      * @javascript Re-compilers must convert the interface invocation of this method directly 
230      * into a JavaScript invocation on its current array instance without changing the 
231      * method name, but expanding variable arguments, if any, into comma-separated values. 
232      */
233     public int push(Vars<?> args);
234     /**
235      * <p>Reverses the order of the elements of the current array instance by rearranging 
236      * them in place without creating a new array. If there are multiple references to the 
237      * array, the new order of the array elements is visible through all references after 
238      * this invocation.</p>
239      * @see jsx.core.ArrayLikes#reverse(ArrayLike)
240      * @since 1.0
241      * @javascript Re-compilers must convert the interface invocation of this method directly 
242      * into a JavaScript invocation on its current array instance without changing the 
243      * method name, but expanding variable arguments, if any, into comma-separated values. 
244      */
245     public void reverse();
246     /**
247      * <p>Removes and returns the first element of the current array instance, shifting 
248      * all subsequent elements down one place to occupy the newly vacant space at the 
249      * start of the array. If the current array is empty, this invocation does nothing 
250      * and returns the undefined value <tt>null</tt>. Note that this invocation does 
251      * not create a new array; instead, it modifies the current array directly.</p>
252      * @return The former first element of the current array.
253      * @see #pop()
254      * @see jsx.core.ArrayLikes#shift(ArrayLike)
255      * @since 1.0
256      * @javascript Re-compilers must convert the interface invocation of this method directly 
257      * into a JavaScript invocation on its current array instance without changing the 
258      * method name, but expanding variable arguments, if any, into comma-separated values. 
259      */
260     public T shift();
261     /**
262      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
263      * it. The returned array contains the element positioned by the first value of the 
264      * argument list and all subsequent elements up to, but not including, the element 
265      * positioned by the second value of the argument list. If the second value is not 
266      * specified or undefined, the returned array contains all elements from the position 
267      * specified by the first value to the end of the current array.</p>
268      * @param args A list of the argument values. The first value specifies the array 
269      * index at which the slice is to begin. If this value is negative, it specifies a 
270      * position measured from the end of the current array. That is, -1 indicates the 
271      * last element, -2 indicates the next from the last element, and so on. The second 
272      * value specifies the array index immediately after the end of the slice. If it is 
273      * undefined or not specified, the slice includes all array elements from the position 
274      * specified by the first value to the end of the array. If the second value is 
275      * negative, it specifies the array element measured from the end of the array.
276      * @return A new array that contains the elements of current array instance from the 
277      * element positioned by the first value of <tt>args</tt>, up to, but not including, 
278      * the element positioned by the second value of <tt>args</tt>.
279      * @see #slice(Object)
280      * @see #slice(Object, Object)
281      * @see #splice(Object)
282      * @see #splice(Vars)
283      * @see #splice(Object, Object)
284      * @see #splice(Object, Object, Object)
285      * @see #splice(Object, Object, Vars)
286      * @since 1.0
287      * @javascript Re-compilers must convert the interface invocation of this method directly 
288      * into a JavaScript invocation on its current array instance without changing the 
289      * method name, but expanding variable arguments, if any, into comma-separated values. 
290      */
291     public ArrayLike<T> slice(Vars<?> args);
292     /**
293      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
294      * it. The returned array contains the element positioned by <tt>start</tt> and 
295      * all subsequent elements up to the end of the current array.</p>
296      * @param start The array index at which the slice is to begin. If negative, this 
297      * argument specifies a position measured from the end of the current array. That is, 
298      * -1 indicates the last element, -2 indicates the next from the last element, and so on.
299      * @return A new array that contains the elements of current array instance from the 
300      * element positioned by <tt>start</tt>, up to the end of the current array.
301      * @see #slice(Object, Object)
302      * @see #slice(Vars)
303      * @see #splice(Object)
304      * @see #splice(Vars)
305      * @see #splice(Object, Object)
306      * @see #splice(Object, Object, Object)
307      * @see #splice(Object, Object, Vars)
308      * @see jsx.core.ArrayLikes#slice(ArrayLike, Object)
309      * @since 1.0
310      * @javascript Re-compilers must convert the interface invocation of this method directly 
311      * into a JavaScript invocation on its current array instance without changing the 
312      * method name, but expanding variable arguments, if any, into comma-separated values. 
313      */
314     public ArrayLike<T> slice(Object start);
315     /**
316      * <p>Returns a slice, or sub-array, of the current array instance without modifying 
317      * it. The returned array contains the element positioned by <tt>start</tt> and 
318      * all subsequent elements up to, but not including, the element positioned by 
319      * <tt>end</tt>. If <tt>end</tt> is an undefined value, the returned array 
320      * contains all elements from the <tt>start</tt> to the end of the current array.</p>
321      * @param start The array index at which the slice is to begin. If negative, this 
322      * argument specifies a position measured from the end of the current array. That is, 
323      * -1 indicates the last element, -2 indicates the next from the last element, and so on.
324      * @param end The array index immediately after the end of the slice. If undefined, 
325      * the slice includes all array elements from the <tt>start</tt> to the end 
326      * of the array. If this argument is negative, it specifies an array element measured 
327      * from the end of the array.
328      * @return A new array that contains the elements of current array instance from the 
329      * element positioned by <tt>start</tt>, up to, but not including, the element 
330      * positioned by <tt>end</tt>.
331      * @see #slice(Object)
332      * @see #slice(Vars)
333      * @see #splice(Object)
334      * @see #splice(Vars)
335      * @see #splice(Object, Object)
336      * @see #splice(Object, Object, Object)
337      * @see #splice(Object, Object, Vars)
338      * @see jsx.core.ArrayLikes#slice(ArrayLike, Object, Object)
339      * @since 1.0
340      * @javascript Re-compilers must convert the interface invocation of this method directly 
341      * into a JavaScript invocation on its current array instance without changing the 
342      * method name, but expanding variable arguments, if any, into comma-separated values. 
343      */
344     public ArrayLike<T> slice(Object start, Object end);
345     /**
346      * <p>Sorts the elements of the current array instance in place by arranging them in 
347      * alphabetical order (more precisely, the order determined by the character encoding).
348      * To do this, elements are first converted to strings, if necessary, so that they can 
349      * be compared. Note that the array is sorted in place, and no copy is made.
350      * And undefined elements are always sorted to the end of the array.</p>
351      * @return A reference to the current array.
352      * @see #sort(JsFunction)
353      * @see jsx.core.ArrayLikes#sort(ArrayLike)
354      * @since 1.0
355      * @javascript Re-compilers must convert the interface invocation of this method directly 
356      * into a JavaScript invocation on its current array instance without changing the 
357      * method name, but expanding variable arguments, if any, into comma-separated values. 
358      */
359     public ArrayLike<T> sort();
360     /**
361      * <p>Sorts the elements of the current array instance with the custom ordering function 
362      * <tt>orderfunc</tt>. Note that the array is sorted in place, and no copy is made.
363      * And undefined elements are always sorted to the end of the array because undefined 
364      * values are never passed to the ordering function you supply.</p>
365      * @param orderfunc A comparison function that compares two values and returns a 
366      * number indicating their relative order. This function should take two arguments, 
367      * <tt>a</tt> and <tt>b</tt> for instance, and should return one of the following:
368      * <ul>
369      * <li>A value less than zero, if, according to your sort criteria, <tt>a</tt> is 
370      * less than <tt>b</tt> and should appear before <tt>b</tt> in the sorted 
371      * array.</li>
372      * <li>Zero, if <tt>a</tt> and <tt>b</tt> are equivalent for the purposes of 
373      * this sort.</li>
374      * <li>A value greater than zero, if <tt>a</tt> is greater than <tt>b</tt> 
375      * for the purposes of the sort.</li>
376      * </ul>
377      * @return A reference to the current array.
378      * @see #sort()
379      * @see jsx.core.ArrayLikes#sort(ArrayLike, JsFunction)
380      * @since 1.0
381      * @javascript Re-compilers must convert the interface invocation of this method directly 
382      * into a JavaScript invocation on its current array instance without changing the 
383      * method name, but expanding variable arguments, if any, into comma-separated values. 
384      */
385     public ArrayLike<T> sort(JsFunction<? extends Number> orderfunc);
386     /**
387      * <p>Deletes elements, numbered by the second value of <tt>args</tt>, starting with and 
388      * including the element positioned by the first value of <tt>args</tt>, and replaces 
389      * them with the values listed by <tt>args</tt> from the third value. Array elements 
390      * that appear after the insertion or deletion are moved as necessary so that they 
391      * remain contiguous with the rest of the array.</p> 
392      * <p>Note that, this invocation modifies the current array directly.</p>
393      * @param args A list of the argument values. The first value specifies the array 
394      * index at which the deletion and insertion is to begin. The second value specifies 
395      * the number of elements, starting with and including the element positioned by the 
396      * first value, to be deleted from the current array. If the second value is undefined, 
397      * this invocation deletes all elements from the position specified by the first value 
398      * to the end of the array. The rest of the list provides the values to be inserted 
399      * into the current array, beginning at the position specified by the first value.
400      * @return An array containing the elements, if any, deleted from the current array.
401      * @see #slice(Vars)
402      * @see #slice(Object)
403      * @see #slice(Object, Object)
404      * @see #splice(Object)
405      * @see #splice(Object, Object)
406      * @see #splice(Object, Object, Object)
407      * @see #splice(Object, Object, Vars)
408      * @since 1.0
409      * @javascript Re-compilers must convert the interface invocation of this method directly 
410      * into a JavaScript invocation on its current array instance without changing the 
411      * method name, but expanding variable arguments, if any, into comma-separated values. 
412      */
413     public ArrayLike<T> splice(Vars<?> args);
414     /**
415      * <p>Deletes zero or more array elements starting with and including the element 
416      * positioned by <tt>start</tt>.</p>
417      * <p>Note that, this invocation modifies the current array directly.</p>
418      * @param start The array index at which the insertion and/or deletion is to begin.
419      * @return An array containing the elements, if any, deleted from the current array.
420      * @see #slice(Vars)
421      * @see #slice(Object)
422      * @see #slice(Object, Object)
423      * @see #splice(Vars)
424      * @see #splice(Object, Object)
425      * @see #splice(Object, Object, Object)
426      * @see #splice(Object, Object, Vars)
427      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object)
428      * @since 1.0
429      * @javascript Re-compilers must convert the interface invocation of this method directly 
430      * into a JavaScript invocation on its current array instance without changing the 
431      * method name, but expanding variable arguments, if any, into comma-separated values. 
432      */
433     public ArrayLike<T> splice(Object start);
434     /**
435      * <p>Deletes <tt>deleteCount</tt> elements of the current array instance starting 
436      * with and including the element positioned by <tt>start</tt>. Array elements 
437      * that appear after deletion are moved as necessary so that they remain contiguous 
438      * with the rest of the array.</p> 
439      * <p>Note that, this invocation modifies the current array directly.</p>
440      * @param start The array index at which the deletion is to begin.
441      * @param deleteCount The number of elements, starting with and including the element 
442      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
443      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
444      * of the array.
445      * @return An array containing the elements, if any, deleted from the current array.
446      * @see #slice(Vars)
447      * @see #slice(Object)
448      * @see #slice(Object, Object)
449      * @see #splice(Object)
450      * @see #splice(Vars)
451      * @see #splice(Object, Object, Object)
452      * @see #splice(Object, Object, Vars)
453      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object, Object)
454      * @since 1.0
455      * @javascript Re-compilers must convert the interface invocation of this method directly 
456      * into a JavaScript invocation on its current array instance without changing the 
457      * method name, but expanding variable arguments, if any, into comma-separated values. 
458      */
459     public ArrayLike<T> splice(Object start, Object deleteCount);
460     /**
461      * <p>Deletes <tt>deleteCount</tt> elements starting with and including the 
462      * element positioned by <tt>start</tt> and replaces them with the argument 
463      * <tt>value</tt>. Array elements that appear after the insertion or deletion are 
464      * moved as necessary so that they remain contiguous with the rest of the array.</p> 
465      * <p>Note that, this invocation modifies the current array directly.</p>
466      * @param start The array index at which the deletion and insertion is to begin.
467      * @param deleteCount The number of elements, starting with and including the element 
468      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
469      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
470      * of the array.
471      * @param value The value to be inserted into the current array, beginning at the index 
472      * specified by <tt>start</tt>.
473      * @return An array containing the elements, if any, deleted from the current array.
474      * @see #slice(Vars)
475      * @see #slice(Object)
476      * @see #slice(Object, Object)
477      * @see #splice(Object)
478      * @see #splice(Vars)
479      * @see #splice(Object, Object)
480      * @see #splice(Object, Object, Vars)
481      * @see jsx.core.ArrayLikes#splice(ArrayLike, Object, Object, Object)
482      * @since 1.0
483      * @javascript Re-compilers must convert the interface invocation of this method directly 
484      * into a JavaScript invocation on its current array instance without changing the 
485      * method name, but expanding variable arguments, if any, into comma-separated values. 
486      */
487     public ArrayLike<T> splice(Object start, Object deleteCount, Object value);
488     /**
489      * <p>Deletes <tt>deleteCount</tt> elements starting with and including the 
490      * element positioned by <tt>start</tt> and replaces them with the values listed by 
491      * <tt>args</tt>. Array elements that appear after the insertion or deletion are 
492      * moved as necessary so that they remain contiguous with the rest of the array.</p> 
493      * <p>Note that, this invocation modifies the current array directly.</p>
494      * @param start The array index at which the deletion and insertion is to begin.
495      * @param deleteCount The number of elements, starting with and including the element 
496      * positioned by <tt>start</tt>, to be deleted from the current array. If this 
497      * argument is undefined, this invocation deletes all elements from <tt>start</tt> to the end 
498      * of the array.
499      * @param args A list of the argument values to be inserted into the current array, 
500      * beginning at the index specified by <tt>start</tt>.
501      * @return An array containing the elements, if any, deleted from the current array.
502      * @see #slice(Vars)
503      * @see #slice(Object)
504      * @see #slice(Object, Object)
505      * @see #splice(Object)
506      * @see #splice(Vars)
507      * @see #splice(Object, Object)
508      * @see #splice(Object, Object, Object)
509      * @since 1.0
510      * @javascript Re-compilers must convert the interface invocation of this method directly 
511      * into a JavaScript invocation on its current array instance without changing the 
512      * method name, but expanding variable arguments, if any, into comma-separated values. 
513      */
514     public ArrayLike<T> splice(Object start, Object deleteCount, Vars<?> args);
515     /**
516      * <p>Inserts a list of values at the beginning of the current array instance, 
517      * shifting the existing elements to higher indexes to make room. The first value of 
518      * the argument list becomes the new element 0 of the array; the second value, if any, 
519      * becomes the new element 1; and so on. Note that this invocation does not create a 
520      * new array; it modifies the current array directly.</p>
521      * @param args A list of the argument values that are inserted at the start of 
522      * the current array.
523      * @return The new length of the current array.
524      * @see #unshift(Object)
525      * @see #shift()
526      * @since 1.0
527      * @javascript Re-compilers must convert the interface invocation of this method directly 
528      * into a JavaScript invocation on its current array instance without changing the 
529      * method name, but expanding variable arguments, if any, into comma-separated values. 
530      */
531     public int unshift(Vars<?> args);
532     /**
533      * <p>Inserts the argument at the beginning of the current array instance, 
534      * shifting the existing elements to higher indexes to make room. The argument becomes 
535      * the new element 0 of the array. Note that this invocation does not create a new 
536      * array; it modifies the current array directly.</p>
537      * @param arg A value that is inserted at the start of the current array.
538      * @return The new length of the current array.
539      * @see #unshift(Vars)
540      * @see #shift()
541      * @see jsx.core.ArrayLikes#unshift(ArrayLike, Object)
542      * @since 1.0
543      * @javascript Re-compilers must convert the interface invocation of this method directly 
544      * into a JavaScript invocation on its current array instance without changing the 
545      * method name, but expanding variable arguments, if any, into comma-separated values. 
546      */
547     public int unshift(Object arg);
548     /**
549      * <p>Returns the primitive value associated with the current instance, if there is one. 
550      * This invocation simply returns the instance itself for the current array instance 
551      * is an object and there is no primitive value for it.</p>
552      * @return The current array itself.
553      * @see #toString()
554      * @since 1.0
555      * @javascript Re-compilers must convert the interface invocation of this method directly 
556      * into a JavaScript invocation on its current array instance without changing the 
557      * method name, but expanding variable arguments, if any, into comma-separated values. 
558      */
559     public ArrayLike<T> valueOf();
560     /**
561      * <p>Simply returns the array object of the current array instance.</p>
562      * <p>This method is useful for JS Simulation to implement opaque types.</p>
563      * <p>If the current instance is a Java simulated array and the method runs in JS 
564      * Embed Simulation mode, the invocation creates and returns a JavaScript Array object 
565      * as a runtime copy of the current array.</p>
566      * @return The array object of the current array instance.
567      * @since 1.0
568      * @javascript Re-compilers must ignore the interface invocation of this method, that is, 
569      * replacing it with its current instance.
570      */
571     public JsArray var();
572 }