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.JsFunction;
023 
024 /**
025  * <p>An <b>opaque</b> interface resembling JavaScript strings.</p>
026  * <p>This interface must be implemented in JS Simulation Libraries.</p>
027  *
028  * @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>
029  * @see js.core.JsGlobal.String#create()
030  * @see js.core.JsGlobal.String#create(Object)
031  * @see jsx.core.StringLikes
032  * 
033  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be 
034  * generated into the target codes. Re-compilers must exit with error on the operations of 
035  * accessing that kind of class objects.
036  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored 
037  * and <tt>instanceof</tt> to it always <tt>true</tt>.
038  */
039 
040 public interface StringLike
041 {
042     /**
043      * <p>Gets the length of the current string, an integer that indicates the number of 
044      * characters in the current string. For any string <tt>s</tt>, the index of the 
045      * last character is <tt>s.length() - 1</tt>. The length property of a string may 
046      * not be deleted.</p>
047      * @return The length of the current string.
048      * @see jsx.core.StringLikes#length(StringLike)
049      * @since 1.0
050      * @javascript Re-compilers must convert the interface invocation of this method into the 
051      * JavaScript expression: 
052      * <pre>s.length</pre>
053      * where <tt>s</tt> is the current string instance of the invocation.
054      */
055     public int length();
056     /**
057      * <p>Returns the character string of length 1 at the specified <tt>index</tt> within 
058      * the current string. An index ranges from 0 to <tt>length() - 1</tt>. The first 
059      * character of the sequence is at index 0, the next at index 1, and so on, as for 
060      * array indexing. If <tt>index</tt> is not between 0 and <tt>length() - 1</tt>, 
061      * this invocation returns an empty string.</p>
062      * @param index The index of the character
063      * @return The character string of length 1 at the specified index of the current string
064      * @see #charCodeAt(Object)
065      * @see #indexOf(Object)
066      * @see #indexOf(Object, Object)
067      * @see #lastIndexOf(Object)
068      * @see #lastIndexOf(Object, Object)
069      * @see jsx.core.StringLikes#charAt(StringLike, Object)
070      * @see jsx.core.StringLikes#charAt(String, Object)
071      * @since 1.0
072      * @javascript Re-compilers must convert the interface invocation of this method directly 
073      * into a JavaScript invocation on its current string instance without changing the 
074      * method name, but expanding variable arguments, if any, into comma-separated values. 
075      */
076     public String charAt(Object index);
077     /**
078      * <p>Returns the character encoding at a specific <tt>index</tt> within the current 
079      * string. An index ranges from 0 to <tt>length() - 1</tt>. The first 
080      * character of the sequence is at index 0, the next at index 1, and so on, as for 
081      * array indexing. If <tt>index</tt> is not between 0 and <tt>length() - 1</tt>, 
082      * this invocation returns <tt>NaN</tt>.</p>
083      * @param index The index of the character
084      * @return The Unicode encoding of the character within the current string. The return 
085      * value is a 16-bit integer between 0 and 65535.
086      * @see #charAt(Object)
087      * @see #indexOf(Object)
088      * @see #indexOf(Object, Object)
089      * @see #lastIndexOf(Object)
090      * @see #lastIndexOf(Object, Object)
091      * @see jsx.core.StringLikes#charCodeAt(StringLike, Object)
092      * @see jsx.core.StringLikes#charCodeAt(String, Object)
093      * @since 1.0
094      * @javascript Re-compilers must convert the interface invocation of this method directly 
095      * into a JavaScript invocation on its current string instance without changing the 
096      * method name, but expanding variable arguments, if any, into comma-separated values. 
097      */
098     public Character charCodeAt(Object index);
099     /**
100      * <p>Converts the argument to a string (if necessary) and appends them, in order, to 
101      * the end of the current string and returns the resulting concatenation.</p>
102      * <p>Note that the current string itself is not modified.</p>
103      * <p>This method is an analog to {@link ArrayLike#concat(Object)}. Note that it is 
104      * often easier to use {@link Js#add(Object, Object)} perform string concatenation.</p>
105      * @param other A value to be concatenated to the current string
106      * @return A new string that results from concatenating the argument to the current 
107      * string.
108      * @see #concat(Vars)
109      * @see ArrayLike#concat(Object)
110      * @see ArrayLike#concat(Vars)
111      * @see jsx.core.StringLikes#concat(StringLike, Object)
112      * @see jsx.core.StringLikes#concat(String, Object)
113      * @since 1.0
114      * @javascript Re-compilers must convert the interface invocation of this method directly 
115      * into a JavaScript invocation on its current string instance without changing the 
116      * method name, but expanding variable arguments, if any, into comma-separated values. 
117      */
118     public String concat(Object other);
119     /**
120      * <p>Converts each of the argument values to a string (if necessary) and appends them, 
121      * in order, to the end of the current string and returns the resulting concatenation.</p>
122      * <p>Note that the current string itself is not modified.</p>
123      * <p>This method is an analog to {@link ArrayLike#concat(Vars)}. Note that it is 
124      * often easier to use {@link Js#add(Object, Object)} perform string concatenation.</p>
125      * @param args A list of the values to be concatenated to the current string
126      * @return A new string that results from concatenating each of the argument values 
127      * to the current string.
128      * @see #concat(Object)
129      * @see ArrayLike#concat(Object)
130      * @see ArrayLike#concat(Vars)
131      * @since 1.0
132      * @javascript Re-compilers must convert the interface invocation of this method directly 
133      * into a JavaScript invocation on its current string instance without changing the 
134      * method name, but expanding variable arguments, if any, into comma-separated values. 
135      */
136     public String concat(Vars<?> args);
137     /**
138      * <p>Searches the current string instance from beginning to end to see if it contains 
139      * an occurrence of the substring <tt>other</tt>. The search begins at the beginning 
140      * of the current string. If an occurrence of the substring is found, this invocation 
141      * returns the position of the first character of the first occurrence of the substring 
142      * within the current string. Character positions within string are numbered starting with 
143      * zero. If no occurrence of substring is found within the current string, this invocation 
144      * returns -1.</p>
145      * @param other The substring that is to be searched for within the current string
146      * @return The position of the first occurrence of <tt>other</tt> within string, if 
147      * any, or -1 if no such occurrence is found.
148      * @see #indexOf(Object, Object)
149      * @see #charAt(Object)
150      * @see #lastIndexOf(Object)
151      * @see #lastIndexOf(Object, Object)
152      * @see #substr(Object)
153      * @see #substr(Object, Object)
154      * @see #substring(Object)
155      * @see #substring(Object, Object)
156      * @see jsx.core.StringLikes#indexOf(StringLike, Object)
157      * @see jsx.core.StringLikes#indexOf(String, Object)
158      * @since 1.0
159      * @javascript Re-compilers must convert the interface invocation of this method directly 
160      * into a JavaScript invocation on its current string instance without changing the 
161      * method name, but expanding variable arguments, if any, into comma-separated values. 
162      */
163     public Integer indexOf(Object other);
164     /**
165      * <p>Searches the current string instance from beginning to end to see if it contains 
166      * an occurrence of the substring <tt>other</tt>. The search begins at position 
167      * <tt>pos</tt> within string, or at the beginning of string if <tt>pos</tt> is  
168      * undefined. If an occurrence of the substring is found, this invocation returns the 
169      * position of the first character of the first occurrence of the substring within 
170      * the current string. Character positions within string are numbered starting with 
171      * zero. If no occurrence of substring is found within the current string, this invocation 
172      * returns -1.</p>
173      * @param other The substring that is to be searched for within the current string
174      * @param pos An optional integer argument that specifies the position within the 
175      * current string at which the search is to start. Legal values are 0 (the position of 
176      * the first character in the string) to <tt>length() - 1</tt> (the position of 
177      * the last character in the string). If this argument is undefined, the search begins 
178      * at the first character of the string
179      * @return The position of the first occurrence of <tt>other</tt> within string that 
180      * appears after the <tt>pos</tt> position, if any, or -1 if no such occurrence 
181      * is found.
182      * @see #indexOf(Object)
183      * @see #charAt(Object)
184      * @see #lastIndexOf(Object)
185      * @see #lastIndexOf(Object, Object)
186      * @see #substr(Object)
187      * @see #substr(Object, Object)
188      * @see #substring(Object)
189      * @see #substring(Object, Object)
190      * @see jsx.core.StringLikes#indexOf(StringLike, Object, Object)
191      * @see jsx.core.StringLikes#indexOf(String, Object, Object)
192      * @since 1.0
193      * @javascript Re-compilers must convert the interface invocation of this method directly 
194      * into a JavaScript invocation on its current string instance without changing the 
195      * method name, but expanding variable arguments, if any, into comma-separated values. 
196      */
197     public Integer indexOf(Object other, Object pos);
198     /**
199      * <p>Searches the current string instance from end to beginning to see if it contains 
200      * an occurrence of the substring <tt>other</tt>. The search begins at the end 
201      * of the current string. If an occurrence of the substring is found, this invocation 
202      * returns the position of the first character of that occurrence. If no occurrence of 
203      * substring is found within the current string, this invocation returns -1.</p>
204      * @param other The substring that is to be searched for within the current string
205      * @return The position of the last occurrence of <tt>other</tt> within string, if 
206      * any, or -1 if no such occurrence is found.
207      * @see #lastIndexOf(Object, Object)
208      * @see #charAt(Object)
209      * @see #indexOf(Object)
210      * @see #indexOf(Object, Object)
211      * @see #substr(Object)
212      * @see #substr(Object, Object)
213      * @see #substring(Object)
214      * @see #substring(Object, Object)
215      * @see jsx.core.StringLikes#lastIndexOf(StringLike, Object)
216      * @see jsx.core.StringLikes#lastIndexOf(String, Object)
217      * @since 1.0
218      * @javascript Re-compilers must convert the interface invocation of this method directly 
219      * into a JavaScript invocation on its current string instance without changing the 
220      * method name, but expanding variable arguments, if any, into comma-separated values. 
221      */
222     public Integer lastIndexOf(Object other);
223     /**
224      * <p>Searches the current string instance from end to beginning to see if it contains 
225      * an occurrence of the substring <tt>other</tt>. The search begins at position 
226      * <tt>pos</tt> within string, or at the end of string if <tt>pos</tt> is  
227      * undefined. If an occurrence of the substring is found, this invocation returns the 
228      * position of the first character that occurrence. Since this method 
229      * searches from end to beginning of the string, the first occurrence found is the last 
230      * one in the string that occurs before the <tt>pos</tt> position. If no occurrence 
231      * of substring is found within the current string, this invocation returns -1.</p>
232      * @param other The substring that is to be searched for within the current string
233      * @param pos An optional integer argument that specifies the position within the 
234      * current string at which the search is to start. Legal values are 0 (the position of 
235      * the first character in the string) to <tt>length() - 1</tt> (the position of 
236      * the last character in the string). If this argument is undefined, the search begins 
237      * at the last character of the string
238      * @return The position of the last occurrence of <tt>other</tt> within string that 
239      * appears before the <tt>pos</tt> position, if any, or -1 if no such occurrence 
240      * is found.
241      * @see #lastIndexOf(Object)
242      * @see #charAt(Object)
243      * @see #indexOf(Object)
244      * @see #indexOf(Object, Object)
245      * @see #substr(Object)
246      * @see #substr(Object, Object)
247      * @see #substring(Object)
248      * @see #substring(Object, Object)
249      * @see jsx.core.StringLikes#lastIndexOf(StringLike, Object, Object)
250      * @see jsx.core.StringLikes#lastIndexOf(String, Object, Object)
251      * @since 1.0
252      * @javascript Re-compilers must convert the interface invocation of this method directly 
253      * into a JavaScript invocation on its current string instance without changing the 
254      * method name, but expanding variable arguments, if any, into comma-separated values. 
255      */
256     public Integer lastIndexOf(Object other, Object pos);
257     /**
258      * <p>Compares strings taking the collation order of the default locale into account.</p>
259      * <p>The ECMAScript standard does not specify how the locale-specific comparison is done; 
260      * it merely specifies that this function utilize the collation order provided by the 
261      * underlying operating system.</p>
262      * @param other A string to be compared, in a locale-sensitive fashion, with the current string
263      * @return An integer number that indicates the result of the comparison. If the current 
264      * string is "less than" the string <tt>other</tt>, this invocation returns a 
265      * number less than zero. If the current string is "greater than" <tt>other</tt>, 
266      * it returns a integer number greater than zero. And if the strings are identical or 
267      * indistinguishable according to the locale ordering conventions, the method returns 0.
268      * @see jsx.core.StringLikes#localeCompare(StringLike, Object)
269      * @see jsx.core.StringLikes#localeCompare(String, Object)
270      * @since 1.0
271      * @javascript Re-compilers must convert the interface invocation of this method directly 
272      * into a JavaScript invocation on its current string instance without changing the 
273      * method name, but expanding variable arguments, if any, into comma-separated values. 
274      */
275     public Integer localeCompare(Object other);
276     /**
277      * <p>Searches the current string for one or more matches of <tt>regexp</tt>. 
278      * The behavior of this invocation depends significantly on whether <tt>regexp</tt> 
279      * has the "g" attribute or not .</p>
280      * <p>If <tt>regexp</tt> does not have the "g" attribute, this invocation searches 
281      * string for a single match. If no match is found, it returns <tt>null</tt>. 
282      * Otherwise, it returns an array containing information about the match that it found. 
283      * Element 0 of the array contains the matched text. The remaining elements contain 
284      * the text that matches any parenthesized subexpressions within the regular expression. 
285      * In addition to these normal array elements, the returned array also has two object 
286      * properties. The <tt>index</tt> property (see {@link ArrayLike#index()}) of the array  
287      * specifies the character position within string of the start of the matched text. Also, 
288      * the <tt>input</tt> property (see {@link ArrayLike#input()}) of the returned array 
289      * is a reference to string itself.</p>
290      * <p>If <tt>regexp</tt> has the "g" flag, this invocation does a global search, 
291      * searching string for all matching substrings. It returns <tt>null</tt> if no 
292      * match is found, and it returns an array if one or more matches are found. The 
293      * contents of this returned array are quite different for global matches, however. In 
294      * this case, the array elements contain each of the matched substrings within string. 
295      * The returned array does not have <tt>index</tt> (see {@link ArrayLike#index()}) 
296      * or <tt>input</tt> (see {@link ArrayLike#input()}) properties in this case. Note 
297      * that for global matches, this invocation does not provide information about 
298      * parenthesized subexpressions, nor does it specify where within string each match 
299      * occurred. If you need to obtain this information for a global search, you can use 
300      * {@link RegExpLike#exec(Object)}.</p>
301      * @param regexp A RegExp object that specifies the pattern to be matched
302      * @return An array containing the results of the match. The contents of the array 
303      * depend on whether regexp has the global "g" attribute set.
304      * @see #replace(RegExpLike, String)
305      * @see #replace(RegExpLike, StringLike)
306      * @see #replace(RegExpLike, JsFunction)
307      * @see #search(RegExpLike)
308      * @see ArrayLike#index()
309      * @see ArrayLike#input()
310      * @see Js#re(String)
311      * @see Js#re(String, String)
312      * @see RegExpLike#exec(Object)
313      * @see RegExpLike#test(Object)
314      * @see jsx.core.StringLikes#match(StringLike, RegExpLike)
315      * @see jsx.core.StringLikes#match(String, RegExpLike)
316      * @since 1.0
317      * @javascript Re-compilers must convert the interface invocation of this method directly 
318      * into a JavaScript invocation on its current string instance without changing the 
319      * method name, but expanding variable arguments, if any, into comma-separated values. 
320      */
321     public ArrayLike<?> match(RegExpLike regexp);
322     /**
323      * <p>Performs a search-and-replace operation on the current string.</p>
324      * <p>This invocation searches the current string for one or more substrings that 
325      * match <tt>regexp</tt> and replaces them with the replacement string 
326      * <tt>newSubStr</tt>.</p>
327      * <p>If <tt>regexp</tt> has the global "g" attribute specified, this invocation 
328      * replaces all matching substrings. Otherwise, it replaces only the first matching 
329      * substring.</p>
330      * <p>Note that the $ character has special meaning within the replacement string 
331      * <tt>newSubStr</tt>. As shown in the following, it indicates that a string 
332      * derived from the pattern match is used in the replacement.</p>
333      * <ul>
334      * <li>$1, $2, ..., $99 The text that matched the 1st through 99th parenthesized 
335      * subexpression within <tt>regexp</tt></li>
336      * <li>$& The substring that matched <tt>regexp</tt></li>
337      * <li>$' The text to the left of the matched substring</li>
338      * <li>$' The text to the right of the matched substring</li>
339      * <li>$$ A literal dollar sign</li>
340      * </ul>
341      * @param regexp The RegExp object that specifies the pattern to be replaced
342      * @param newSubStr A string that specifies the replacement text
343      * @return A new string, with the first match, or all matches, of <tt>regexp</tt> 
344      * replaced with the replacement.
345      * @see #replace(RegExpLike, StringLike)
346      * @see #replace(RegExpLike, JsFunction)
347      * @see #match(RegExpLike)
348      * @see #search(RegExpLike)
349      * @see Js#re(String)
350      * @see Js#re(String, String)
351      * @see RegExpLike#exec(Object)
352      * @see RegExpLike#test(Object)
353      * @see jsx.core.StringLikes#replace(StringLike, RegExpLike, String)
354      * @see jsx.core.StringLikes#replace(String, RegExpLike, String)
355      * @since 1.0
356      * @javascript Re-compilers must convert the interface invocation of this method directly 
357      * into a JavaScript invocation on its current string instance without changing the 
358      * method name, but expanding variable arguments, if any, into comma-separated values. 
359      */
360     public String replace(RegExpLike regexp, String newSubStr);
361     /**
362      * <p>Performs a search-and-replace operation on the current string.</p>
363      * <p>This invocation searches the current string for one or more substrings that 
364      * match <tt>regexp</tt> and replaces them with the replacement string 
365      * <tt>newSubStr</tt>.</p>
366      * <p>If <tt>regexp</tt> has the global "g" attribute specified, this invocation 
367      * replaces all matching substrings. Otherwise, it replaces only the first matching 
368      * substring.</p>
369      * <p>Note that the $ character has special meaning within the replacement string 
370      * <tt>newSubStr</tt>. As shown in the following, it indicates that a string 
371      * derived from the pattern match is used in the replacement.</p>
372      * <ul>
373      * <li>$1, $2, ..., $99 The text that matched the 1st through 99th parenthesized 
374      * subexpression within <tt>regexp</tt></li>
375      * <li>$& The substring that matched <tt>regexp</tt></li>
376      * <li>$' The text to the left of the matched substring</li>
377      * <li>$' The text to the right of the matched substring</li>
378      * <li>$$ A literal dollar sign</li>
379      * </ul>
380      * @param regexp The RegExp object that specifies the pattern to be replaced
381      * @param newSubStr A string that specifies the replacement text
382      * @return A new string, with the first match, or all matches, of <tt>regexp</tt> 
383      * replaced with the replacement.
384      * @see #replace(RegExpLike, String)
385      * @see #replace(RegExpLike, JsFunction)
386      * @see #match(RegExpLike)
387      * @see #search(RegExpLike)
388      * @see Js#re(String)
389      * @see Js#re(String, String)
390      * @see RegExpLike#exec(Object)
391      * @see RegExpLike#test(Object)
392      * @see jsx.core.StringLikes#replace(StringLike, RegExpLike, StringLike)
393      * @see jsx.core.StringLikes#replace(String, RegExpLike, StringLike)
394      * @since 1.0
395      * @javascript Re-compilers must convert the interface invocation of this method directly 
396      * into a JavaScript invocation on its current string instance without changing the 
397      * method name, but expanding variable arguments, if any, into comma-separated values. 
398      */
399     public String replace(RegExpLike regexp, StringLike newSubStr);
400     /**
401      * <p>Performs a search-and-replace operation on the current string.</p>
402      * <p>This invocation searches the current string for one or more substrings that 
403      * match <tt>regexp</tt> and replaces them with the replacement string generated by 
404      * <tt>lambda</tt>.</p>
405      * <p>If <tt>regexp</tt> has the global "g" attribute specified, this invocation 
406      * replaces all matching substrings. Otherwise, it replaces only the first matching 
407      * substring.</p>
408      * @param regexp The RegExp object that specifies the pattern to be replaced
409      * @param lambda A function that is invoked to generate the replacement text
410      * @return A new string, with the first match, or all matches, of <tt>regexp</tt> 
411      * replaced with the replacement.
412      * @see #replace(RegExpLike, String)
413      * @see #replace(RegExpLike, StringLike)
414      * @see #match(RegExpLike)
415      * @see #search(RegExpLike)
416      * @see Js#re(String)
417      * @see Js#re(String, String)
418      * @see RegExpLike#exec(Object)
419      * @see RegExpLike#test(Object)
420      * @see jsx.core.StringLikes#replace(StringLike, RegExpLike, JsFunction)
421      * @see jsx.core.StringLikes#replace(String, RegExpLike, JsFunction)
422      * @since 1.0
423      * @javascript Re-compilers must convert the interface invocation of this method directly 
424      * into a JavaScript invocation on its current string instance without changing the 
425      * method name, but expanding variable arguments, if any, into comma-separated values. 
426      */
427     public String replace(RegExpLike regexp, JsFunction<String> lambda);
428     /**
429      * <p>Looks for a substring matching <tt>regexp</tt> within the current string 
430      * and returns the position of the first character of the matching substring, 
431      * or -1 if no match was found.</p>
432      * <p>This invocation does not do global matches; it ignores the "g" flag of 
433      * <tt>regexp</tt>. It also ignores the <tt>lastIndex</tt> property 
434      * (see {@link RegExpLike#lastIndex()} and {@link RegExpLike#lastIndex(Integer)}) of 
435      * <tt>regexp</tt> and always searches from the beginning of the string, which 
436      * means that it always returns the position of the first match in the string.</p>
437      * @param regexp A RegExp object that specifies the pattern to be searched for in the current string.
438      * @return The position of the start of the first substring of the current string 
439      * that matches <tt>regexp</tt>, or -1 if no match is found.
440      * @see #replace(RegExpLike, String)
441      * @see #replace(RegExpLike, StringLike)
442      * @see #replace(RegExpLike, JsFunction)
443      * @see #match(RegExpLike)
444      * @see Js#re(String)
445      * @see Js#re(String, String)
446      * @see RegExpLike#exec(Object)
447      * @see RegExpLike#test(Object)
448      * @see jsx.core.StringLikes#search(StringLike, RegExpLike)
449      * @see jsx.core.StringLikes#search(String, RegExpLike)
450      * @since 1.0
451      * @javascript Re-compilers must convert the interface invocation of this method directly 
452      * into a JavaScript invocation on its current string instance without changing the 
453      * method name, but expanding variable arguments, if any, into comma-separated values. 
454      */
455     public Integer search(RegExpLike regexp);
456     /**
457      * <p>Returns a string containing a slice, or substring, of the current string without 
458      * modify it.</p>
459      * @param begin The string index where the slice is to begin. If negative, this argument 
460      * specifies a position measured from the end of the string. That is, -1 indicates the 
461      * last character, -2 indicates the second from last character, and so on.
462      * @return A new string that contains all the characters of string from and including 
463      * <tt>begin</tt>.
464      * @see #slice(Object, Object)
465      * @see #substr(Object)
466      * @see #substr(Object, Object)
467      * @see #substring(Object)
468      * @see #substring(Object, Object)
469      * @see ArrayLike#slice(Object)
470      * @see ArrayLike#slice(Object, Object)
471      * @see ArrayLike#slice(Vars)
472      * @see jsx.core.StringLikes#slice(StringLike, Object)
473      * @see jsx.core.StringLikes#slice(String, Object)
474      * @since 1.0
475      * @javascript Re-compilers must convert the interface invocation of this method directly 
476      * into a JavaScript invocation on its current string instance without changing the 
477      * method name, but expanding variable arguments, if any, into comma-separated values. 
478      */
479     public String slice(Object begin);
480     /**
481      * <p>Returns a string containing a slice, or substring, of the current string without 
482      * modify it.</p>
483      * @param begin The string index where the slice is to begin. If negative, this argument 
484      * specifies a position measured from the end of the string. That is, -1 indicates the 
485      * last character, -2 indicates the second from last character, and so on.
486      * @param end The string index immediately after the end of the slice. If undefined, 
487      * the slice includes all characters from <tt>begin</tt> to the end of the string. 
488      * If this argument is negative, it specifies a position measured from the end of the 
489      * string.
490      * @return A new string that contains all the characters of string from and including 
491      * <tt>begin</tt>, and up to but not including <tt>end</tt>.
492      * @see #slice(Object, Object)
493      * @see #substr(Object)
494      * @see #substr(Object, Object)
495      * @see #substring(Object)
496      * @see #substring(Object, Object)
497      * @see ArrayLike#slice(Object)
498      * @see ArrayLike#slice(Object, Object)
499      * @see ArrayLike#slice(Vars)
500      * @see jsx.core.StringLikes#slice(StringLike, Object, Object)
501      * @see jsx.core.StringLikes#slice(String, Object, Object)
502      * @since 1.0
503      * @javascript Re-compilers must convert the interface invocation of this method directly 
504      * into a JavaScript invocation on its current string instance without changing the 
505      * method name, but expanding variable arguments, if any, into comma-separated values. 
506      */
507     public String slice(Object begin, Object end);
508     /**
509      * <p>Creates and returns an array of substrings of the current string. These 
510      * substrings are created by searching the string from start to end for text that 
511      * matches <tt>separator</tt> and breaking the string before and after that 
512      * matching text. The <tt>separator</tt> text is not included in any of the 
513      * returned substrings, except as noted at the end of this section. Note that if the 
514      * <tt>separator</tt> matches the beginning of the string, the first element of 
515      * the returned array will be an empty string, the text that appears before the 
516      * <tt>separator</tt>. Similarly, if the <tt>separator</tt> matches the end of 
517      * the string, the last element of the array will be the empty string.</p>
518      * <p>If <tt>separator</tt> is undefined, the current string is not split at all, 
519      * and the returned array contains only a single, unbroken string element. If 
520      * <tt>separator</tt> is the empty string or a regular expression that matches 
521      * the empty string, the string is broken between each character, and the returned 
522      * array has the same length as the string does. Note that this is a special case 
523      * because the empty strings before the first character and after the last character 
524      * are not matched.</p>
525      * <p>As noted earlier, the substrings in the array returned by this invocation do not 
526      * contain the delimiting text <tt>separator</tt> used to split the string. However, 
527      * if <tt>separator</tt> is a regular expression that contains parenthesized 
528      * subexpressions, the substrings that match those parenthesized subexpressions 
529      * (but not the text that matches the regular expression as a whole) are included in 
530      * the returned array.</p>
531      * <p>Note that this method is the inverse of the {@link ArrayLike#join()} or 
532      * {@link ArrayLike#join(Object)} method.</p>
533      * @param separator The string or regular expression at which the current string splits.
534      * @return An array of strings, created by splitting string into substrings at the 
535      * boundaries specified by <tt>separator</tt>. The substrings in the returned 
536      * array do not include <tt>separator</tt> itself, except in the case noted in the 
537      * above description.
538      * @see #split(Object, Object)
539      * @see ArrayLike#join()
540      * @see ArrayLike#join(Object)
541      * @see jsx.core.StringLikes#split(StringLike, Object)
542      * @see jsx.core.StringLikes#split(String, Object)
543      * @since 1.0
544      * @javascript Re-compilers must convert the interface invocation of this method directly 
545      * into a JavaScript invocation on its current string instance without changing the 
546      * method name, but expanding variable arguments, if any, into comma-separated values. 
547      */
548     public ArrayLike<?> split(Object separator);
549     /**
550      * <p>Creates and returns an array of as many as <tt>limit</tt> substrings of the 
551      * current string. These substrings are created by searching the string from start to 
552      * end for text that matches <tt>separator</tt> and breaking the string before and 
553      * after that matching text. The <tt>separator</tt> text is not included in any of 
554      * the returned substrings, except as noted at the end of this section. Note that if 
555      * the <tt>separator</tt> matches the beginning of the string, the first element 
556      * of the returned array will be an empty string, the text that appears before the 
557      * <tt>separator</tt>. Similarly, if the <tt>separator</tt> matches the end of 
558      * the string, the last element of the array (assuming no conflicting <tt>limit</tt>) 
559      * will be the empty string.</p>
560      * <p>If <tt>separator</tt> is undefined, the current string is not split at all, 
561      * and the returned array contains only a single, unbroken string element. If 
562      * <tt>separator</tt> is the empty string or a regular expression that matches 
563      * the empty string, the string is broken between each character, and the returned 
564      * array has the same length as the string does, assuming no smaller <tt>limit</tt> 
565      * is specified. Note that this is a special case because the empty strings before 
566      * the first character and after the last character are not matched.</p>
567      * <p>As noted earlier, the substrings in the array returned by this invocation do not 
568      * contain the delimiting text <tt>separator</tt> used to split the string. However, 
569      * if <tt>separator</tt> is a regular expression that contains parenthesized 
570      * subexpressions, the substrings that match those parenthesized subexpressions 
571      * (but not the text that matches the regular expression as a whole) are included in 
572      * the returned array.</p>
573      * <p>Note that this method is the inverse of the {@link ArrayLike#join()} or 
574      * {@link ArrayLike#join(Object)} method.</p>
575      * @param separator The string or regular expression at which the current string splits.
576      * @param limit This optional integer specifies the maximum length of the returned 
577      * array. If defined, no more than this number of substrings will be returned. 
578      * If undefined, the entire string will be split, regardless of its length.
579      * @return An array of strings, created by splitting string into substrings at the 
580      * boundaries specified by <tt>separator</tt>. The substrings in the returned 
581      * array do not include <tt>separator</tt> itself, except in the case noted in the 
582      * above description.
583      * @see #split(Object)
584      * @see ArrayLike#join()
585      * @see ArrayLike#join(Object)
586      * @see jsx.core.StringLikes#split(StringLike, Object, Object)
587      * @see jsx.core.StringLikes#split(String, Object, Object)
588      * @since 1.0
589      * @javascript Re-compilers must convert the interface invocation of this method directly 
590      * into a JavaScript invocation on its current string instance without changing the 
591      * method name, but expanding variable arguments, if any, into comma-separated values. 
592      */
593     public ArrayLike<?> split(Object separator, Object limit);
594     /**
595      * <p>Extracts and returns a substring of the current string without modifying it.</p>
596      * <p>Note that this method has not been standardized by ECMAScript and is therefore 
597      * deprecated</p>
598      * @param start The start position of the substring. If this argument is negative, it 
599      * specifies a position measured from the end of the string: -1 specifies the last character, 
600      * -2 specifies the second-to-last character, and so on.
601      * @return A copy of the portion of the current string starting at and including the character 
602      * specified by <tt>start</tt> to the end of the string.
603      * @see #substr(Object)
604      * @see #slice(Object)
605      * @see #slice(Object, Object)
606      * @see #substring(Object)
607      * @see #substring(Object, Object)
608      * @see jsx.core.StringLikes#substr(StringLike, Object)
609      * @see jsx.core.StringLikes#substr(String, Object)
610      * @since 1.0
611      * @javascript Re-compilers must convert the interface invocation of this method directly 
612      * into a JavaScript invocation on its current string instance without changing the 
613      * method name, but expanding variable arguments, if any, into comma-separated values. 
614      */
615     public String substr(Object start);
616     /**
617      * <p>Extracts and returns a substring of the current string without modifying it.</p>
618      * <p>Note this method specifies the desired substring with a character position and a 
619      * <tt>length</tt>. This provides a useful alternative to 
620      * {@link StringLike#substring(Object, Object)}, which specify a substring with two 
621      * character positions. Note, however, that this method has not been standardized by 
622      * ECMAScript and is therefore deprecated</p>
623      * @param start The start position of the substring. If this argument is negative, it 
624      * specifies a position measured from the end of the string: -1 specifies the last character, 
625      * -2 specifies the second-to-last character, and so on.
626      * @param length The number of characters in the substring. If this argument is undefined, 
627      * the returned substring includes all characters from the starting position to the end of 
628      * the string.
629      * @return A copy of the portion of the current string starting at and including the character 
630      * specified by <tt>start</tt> and continuing for <tt>length</tt> characters, 
631      * or to the end of the string if <tt>length</tt> is undefined.
632      * @see #substr(Object)
633      * @see #slice(Object)
634      * @see #slice(Object, Object)
635      * @see #substring(Object)
636      * @see #substring(Object, Object)
637      * @see jsx.core.StringLikes#substr(StringLike, Object, Object)
638      * @see jsx.core.StringLikes#substr(String, Object, Object)
639      * @since 1.0
640      * @javascript Re-compilers must convert the interface invocation of this method directly 
641      * into a JavaScript invocation on its current string instance without changing the 
642      * method name, but expanding variable arguments, if any, into comma-separated values. 
643      */
644     public String substr(Object start, Object length);
645     /**
646      * <p>Returns a substring of the current string consisting of the characters from 
647      * position <tt>from</tt> to the end of the string. The character at position 
648      * <tt>from</tt> is included.</p>
649      * <p>It is important to remember that the character at position <tt>from</tt> is 
650      * included in the substring.</p>
651      * <p>Note that {@link StringLike#slice(Object)} and the nonstandard 
652      * {@link StringLike#substr(Object)} can also extract substrings from a string. 
653      * Unlike those methods, this method does not accept negative arguments.</p>
654      * @param from A nonnegative integer that specifies the position within the current 
655      * string of the first character of the desired substring.
656      * @return  A substring of the current string containing characters copied from 
657      * position <tt>from</tt> to the end of the current string.
658      * @see #substring(Object, Object)
659      * @see #charAt(Object)
660      * @see #indexOf(Object)
661      * @see #indexOf(Object, Object)
662      * @see #lastIndexOf(Object)
663      * @see #lastIndexOf(Object, Object)
664      * @see #slice(Object)
665      * @see #slice(Object, Object)
666      * @see #substr(Object)
667      * @see #substr(Object, Object)
668      * @see jsx.core.StringLikes#substring(StringLike, Object)
669      * @see jsx.core.StringLikes#substring(String, Object)
670      * @since 1.0
671      * @javascript Re-compilers must convert the interface invocation of this method directly 
672      * into a JavaScript invocation on its current string instance without changing the 
673      * method name, but expanding variable arguments, if any, into comma-separated values. 
674      */
675     public String substring(Object from);
676     /**
677      * <p>Returns a substring of the current string consisting of the characters between 
678      * positions <tt>from</tt> and <tt>to</tt>. The character at position <tt>from</tt> 
679      * is included, but the character at position <tt>to</tt> is not included.</p>
680      * <p>If <tt>from</tt> equals <tt>to</tt>, this method returns an empty 
681      * (length 0) string. If <tt>from</tt> is greater than <tt>to</tt>, this method 
682      * first swaps the two arguments and then returns the substring between them.</p>
683      * <p>It is important to remember that the character at position <tt>from</tt> is 
684      * included in the substring but that the character at position <tt>to</tt> is 
685      * not included in the substring. While this may seem arbitrary or counter-intuitive, 
686      * a notable feature of this system is that the length of the returned substring is 
687      * always equal to <tt>to - from</tt>.</p>
688      * <p>Note that {@link StringLike#slice(Object, Object)} and the nonstandard 
689      * {@link StringLike#substr(Object, Object)} can also extract substrings from a string. 
690      * Unlike those methods, this method does not accept negative arguments.</p>
691      * @param from A nonnegative integer that specifies the position within the current 
692      * string of the first character of the desired substring.
693      * @param to A nonnegative optional integer that is one greater than the position of 
694      * the last character of the desired substring. If this argument is undefined, the 
695      * returned substring runs to the end of the string.
696      * @return A new string, of length <tt>to - from</tt>, which contains a substring 
697      * of the current string. The new string contains characters copied from positions 
698      * <tt>from</tt> to <tt>to</tt> - 1 of the string.
699      * @see #substring(Object)
700      * @see #charAt(Object)
701      * @see #indexOf(Object)
702      * @see #indexOf(Object, Object)
703      * @see #lastIndexOf(Object)
704      * @see #lastIndexOf(Object, Object)
705      * @see #slice(Object)
706      * @see #slice(Object, Object)
707      * @see #substr(Object)
708      * @see #substr(Object, Object)
709      * @see jsx.core.StringLikes#substring(StringLike, Object, Object)
710      * @see jsx.core.StringLikes#substring(String, Object, Object)
711      * @since 1.0
712      * @javascript Re-compilers must convert the interface invocation of this method directly 
713      * into a JavaScript invocation on its current string instance without changing the 
714      * method name, but expanding variable arguments, if any, into comma-separated values. 
715      */
716     public String substring(Object from, Object to);
717     /**
718      * <p>Returns a copy of string, with each upper-case letter converted to its lower-case 
719      * equivalent, if it has one.</p>
720      * @return A copy of string, with each upper-case letter converted to its lower-case 
721      * equivalent, if it has one.
722      * @see #toLocaleLowerCase()
723      * @see #toLocaleUpperCase()
724      * @see #toUpperCase()
725      * @see jsx.core.StringLikes#toLowerCase(StringLike)
726      * @see jsx.core.StringLikes#toLowerCase(String)
727      * @since 1.0
728      * @javascript Re-compilers must convert the interface invocation of this method directly 
729      * into a JavaScript invocation on its current string instance without changing the 
730      * method name, but expanding variable arguments, if any, into comma-separated values. 
731      */
732     public String toLowerCase();
733     /**
734      * <p>Returns a copy of string, with each lower-case letter converted to its upper-case 
735      * equivalent, if it has one.</p>
736      * @return A copy of string, with each lower-case letter converted to its upper-case 
737      * equivalent, if it has one.
738      * @see #toLocaleLowerCase()
739      * @see #toLocaleUpperCase()
740      * @see #toLowerCase()
741      * @see jsx.core.StringLikes#toUpperCase(StringLike)
742      * @see jsx.core.StringLikes#toUpperCase(String)
743      * @since 1.0
744      * @javascript Re-compilers must convert the interface invocation of this method directly 
745      * into a JavaScript invocation on its current string instance without changing the 
746      * method name, but expanding variable arguments, if any, into comma-separated values. 
747      */
748     public String toUpperCase();
749     /**
750      * <p>Returns a copy of the current string, converted to lower-case letters in a 
751      * locale-specific way. Only a few languages, such as Turkish, have locale-specific 
752      * case mappings, so this method usually returns the same value as 
753      * {@link #toLowerCase()}.</p>
754      * @return A copy of the current string, converted to lower-case letters in a 
755      * locale-specific way.
756      * @see #toLocaleUpperCase()
757      * @see #toLowerCase()
758      * @see #toUpperCase()
759      * @see jsx.core.StringLikes#toLocaleLowerCase(StringLike)
760      * @see jsx.core.StringLikes#toLocaleLowerCase(String)
761      * @since 1.0
762      * @javascript Re-compilers must convert the interface invocation of this method directly 
763      * into a JavaScript invocation on its current string instance without changing the 
764      * method name, but expanding variable arguments, if any, into comma-separated values. 
765      */
766     public String toLocaleLowerCase();
767     /**
768      * <p>Returns a copy of the current string, converted to upper-case letters in a 
769      * locale-specific way. Only a few languages, such as Turkish, have locale-specific 
770      * case mappings, so this method usually returns the same value as 
771      * {@link #toUpperCase()}.</p>
772      * @return A copy of the current string, converted to upper-case letters in a 
773      * locale-specific way.
774      * @see #toLocaleLowerCase()
775      * @see #toLowerCase()
776      * @see #toUpperCase()
777      * @see jsx.core.StringLikes#toLocaleUpperCase(StringLike)
778      * @see jsx.core.StringLikes#toLocaleUpperCase(String)
779      * @since 1.0
780      * @javascript Re-compilers must convert the interface invocation of this method directly 
781      * into a JavaScript invocation on its current string instance without changing the 
782      * method name, but expanding variable arguments, if any, into comma-separated values. 
783      */
784     public String toLocaleUpperCase();
785     /**
786      * <p>Returns the string representing the current instance, that is the current 
787      * string itself.</p>
788      * @return A string representing the current instance.
789      * @see #valueOf()
790      * @since 1.0
791      * @javascript Re-compilers must convert the interface invocation of this method directly 
792      * into a JavaScript invocation on its current string instance without changing the 
793      * method name, but expanding variable arguments, if any, into comma-separated values. 
794      */
795     public String toString();
796     /**
797      * <p>Returns a string indicating the data-type of the current instance.</p>
798      * <p>Simulating the JavaScript <tt>typeof</tt> operator and <tt>typeof()</tt> 
799      * function, this invocation evaluates to "number", "string", or "boolean" if the current 
800      * instance is a number, string, or boolean value. It evaluates to "object" for objects, 
801      * arrays. It evaluates to "function" for function instance and to "undefined" if the 
802      * current instance is undefined.</p>
803      * @return A string indicating the data-type of the instance.
804      * @see #valueOf()
805      * @see #undefined()
806      * @since 1.0
807      * @javascript Re-compilers must convert the interface invocation of this method into the 
808      * JavaScript expression: 
809      * <pre>typeof s</pre>
810      * where <tt>s</tt> is the current string instance of the invocation.
811      */
812     public String typeof();
813     /**
814      * <p>Checks if the current instance is undefined.</p>
815      * @return <tt>true</tt> if the current instance is undefined; <tt>false</tt> otherwise.
816      * @see #valueOf()
817      * @see #undefined()
818      * @since 1.0
819      * @javascript Re-compilers must convert the interface invocation of this method into the 
820      * JavaScript expression: 
821      * <pre>(s === undefined)</pre>
822      * where <tt>s</tt> is the current string instance of the invocation.
823      */
824     public boolean undefined();
825     /**
826      * <p>Returns the primitive value associated with the current instance, if there is one. 
827      * This invocation returns the same thing as {@link #toString()}.</p>
828      * @return The primitive string value associated with the current instance.
829      * @see #toString()
830      * @since 1.0
831      * @javascript Re-compilers must convert the interface invocation of this method directly 
832      * into a JavaScript invocation on its current string instance without changing the 
833      * method name, but expanding variable arguments, if any, into comma-separated values. 
834      */
835     public String valueOf();
836 }