1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 only, as
8  * published by the Free Software Foundation.  Oracle designates this
9  * particular file as subject to the "Classpath" exception as provided
10  * by Oracle in the LICENSE file that accompanied this code.
11  *
12  * This code is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * version 2 for more details (a copy is included in the LICENSE file that
16  * accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License version
19  * 2 along with this work; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23  * or visit www.oracle.com if you need additional information or have any
24  * questions.
25  */
26 
27 package java.lang;
28 
29 import android.compat.annotation.UnsupportedAppUsage;
30 
31 @SuppressWarnings({"unchecked", "deprecation", "all"})
32 public final class String
33         implements java.io.Serializable,
34                 java.lang.Comparable<java.lang.String>,
35                 java.lang.CharSequence {
36 
String()37     public String() {
38         throw new RuntimeException("Stub!");
39     }
40 
String(java.lang.String original)41     public String(java.lang.String original) {
42         throw new RuntimeException("Stub!");
43     }
44 
String(char[] value)45     public String(char[] value) {
46         throw new RuntimeException("Stub!");
47     }
48 
String(char[] value, int offset, int count)49     public String(char[] value, int offset, int count) {
50         throw new RuntimeException("Stub!");
51     }
52 
String(int[] codePoints, int offset, int count)53     public String(int[] codePoints, int offset, int count) {
54         throw new RuntimeException("Stub!");
55     }
56 
57     @Deprecated
String(byte[] ascii, int hibyte, int offset, int count)58     public String(byte[] ascii, int hibyte, int offset, int count) {
59         throw new RuntimeException("Stub!");
60     }
61 
62     @Deprecated
String(byte[] ascii, int hibyte)63     public String(byte[] ascii, int hibyte) {
64         throw new RuntimeException("Stub!");
65     }
66 
String(byte[] bytes, int offset, int length, java.lang.String charsetName)67     public String(byte[] bytes, int offset, int length, java.lang.String charsetName)
68             throws java.io.UnsupportedEncodingException {
69         throw new RuntimeException("Stub!");
70     }
71 
String(byte[] bytes, int offset, int length, java.nio.charset.Charset charset)72     public String(byte[] bytes, int offset, int length, java.nio.charset.Charset charset) {
73         throw new RuntimeException("Stub!");
74     }
75 
String(byte[] bytes, java.lang.String charsetName)76     public String(byte[] bytes, java.lang.String charsetName)
77             throws java.io.UnsupportedEncodingException {
78         throw new RuntimeException("Stub!");
79     }
80 
String(byte[] bytes, java.nio.charset.Charset charset)81     public String(byte[] bytes, java.nio.charset.Charset charset) {
82         throw new RuntimeException("Stub!");
83     }
84 
String(byte[] bytes, int offset, int length)85     public String(byte[] bytes, int offset, int length) {
86         throw new RuntimeException("Stub!");
87     }
88 
String(byte[] bytes)89     public String(byte[] bytes) {
90         throw new RuntimeException("Stub!");
91     }
92 
String(java.lang.StringBuffer buffer)93     public String(java.lang.StringBuffer buffer) {
94         throw new RuntimeException("Stub!");
95     }
96 
String(java.lang.StringBuilder builder)97     public String(java.lang.StringBuilder builder) {
98         throw new RuntimeException("Stub!");
99     }
100 
101     @Deprecated
102     @UnsupportedAppUsage
String(int offset, int count, char[] value)103     String(int offset, int count, char[] value) {
104         throw new RuntimeException("Stub!");
105     }
106 
length()107     public int length() {
108         throw new RuntimeException("Stub!");
109     }
110 
isEmpty()111     public boolean isEmpty() {
112         throw new RuntimeException("Stub!");
113     }
114 
charAt(int index)115     public native char charAt(int index);
116 
codePointAt(int index)117     public int codePointAt(int index) {
118         throw new RuntimeException("Stub!");
119     }
120 
codePointBefore(int index)121     public int codePointBefore(int index) {
122         throw new RuntimeException("Stub!");
123     }
124 
codePointCount(int beginIndex, int endIndex)125     public int codePointCount(int beginIndex, int endIndex) {
126         throw new RuntimeException("Stub!");
127     }
128 
offsetByCodePoints(int index, int codePointOffset)129     public int offsetByCodePoints(int index, int codePointOffset) {
130         throw new RuntimeException("Stub!");
131     }
132 
getChars(char[] dst, int dstBegin)133     void getChars(char[] dst, int dstBegin) {
134         throw new RuntimeException("Stub!");
135     }
136 
getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)137     public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {
138         throw new RuntimeException("Stub!");
139     }
140 
141     @UnsupportedAppUsage
getCharsNoCheck(int start, int end, char[] buffer, int index)142     native void getCharsNoCheck(int start, int end, char[] buffer, int index);
143 
144     @Deprecated
getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)145     public void getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin) {
146         throw new RuntimeException("Stub!");
147     }
148 
getBytes(java.lang.String charsetName)149     public byte[] getBytes(java.lang.String charsetName)
150             throws java.io.UnsupportedEncodingException {
151         throw new RuntimeException("Stub!");
152     }
153 
getBytes(java.nio.charset.Charset charset)154     public byte[] getBytes(java.nio.charset.Charset charset) {
155         throw new RuntimeException("Stub!");
156     }
157 
getBytes()158     public byte[] getBytes() {
159         throw new RuntimeException("Stub!");
160     }
161 
equals(java.lang.Object anObject)162     public boolean equals(java.lang.Object anObject) {
163         throw new RuntimeException("Stub!");
164     }
165 
contentEquals(java.lang.StringBuffer sb)166     public boolean contentEquals(java.lang.StringBuffer sb) {
167         throw new RuntimeException("Stub!");
168     }
169 
nonSyncContentEquals(java.lang.AbstractStringBuilder sb)170     private boolean nonSyncContentEquals(java.lang.AbstractStringBuilder sb) {
171         throw new RuntimeException("Stub!");
172     }
173 
contentEquals(java.lang.CharSequence cs)174     public boolean contentEquals(java.lang.CharSequence cs) {
175         throw new RuntimeException("Stub!");
176     }
177 
equalsIgnoreCase(java.lang.String anotherString)178     public boolean equalsIgnoreCase(java.lang.String anotherString) {
179         throw new RuntimeException("Stub!");
180     }
181 
compareTo(java.lang.String anotherString)182     public native int compareTo(java.lang.String anotherString);
183 
compareToIgnoreCase(java.lang.String str)184     public int compareToIgnoreCase(java.lang.String str) {
185         throw new RuntimeException("Stub!");
186     }
187 
regionMatches(int toffset, java.lang.String other, int ooffset, int len)188     public boolean regionMatches(int toffset, java.lang.String other, int ooffset, int len) {
189         throw new RuntimeException("Stub!");
190     }
191 
regionMatches( boolean ignoreCase, int toffset, java.lang.String other, int ooffset, int len)192     public boolean regionMatches(
193             boolean ignoreCase, int toffset, java.lang.String other, int ooffset, int len) {
194         throw new RuntimeException("Stub!");
195     }
196 
startsWith(java.lang.String prefix, int toffset)197     public boolean startsWith(java.lang.String prefix, int toffset) {
198         throw new RuntimeException("Stub!");
199     }
200 
startsWith(java.lang.String prefix)201     public boolean startsWith(java.lang.String prefix) {
202         throw new RuntimeException("Stub!");
203     }
204 
endsWith(java.lang.String suffix)205     public boolean endsWith(java.lang.String suffix) {
206         throw new RuntimeException("Stub!");
207     }
208 
hashCode()209     public int hashCode() {
210         throw new RuntimeException("Stub!");
211     }
212 
indexOf(int ch)213     public int indexOf(int ch) {
214         throw new RuntimeException("Stub!");
215     }
216 
indexOf(int ch, int fromIndex)217     public int indexOf(int ch, int fromIndex) {
218         throw new RuntimeException("Stub!");
219     }
220 
indexOfSupplementary(int ch, int fromIndex)221     private int indexOfSupplementary(int ch, int fromIndex) {
222         throw new RuntimeException("Stub!");
223     }
224 
lastIndexOf(int ch)225     public int lastIndexOf(int ch) {
226         throw new RuntimeException("Stub!");
227     }
228 
lastIndexOf(int ch, int fromIndex)229     public int lastIndexOf(int ch, int fromIndex) {
230         throw new RuntimeException("Stub!");
231     }
232 
lastIndexOfSupplementary(int ch, int fromIndex)233     private int lastIndexOfSupplementary(int ch, int fromIndex) {
234         throw new RuntimeException("Stub!");
235     }
236 
indexOf(java.lang.String str)237     public int indexOf(java.lang.String str) {
238         throw new RuntimeException("Stub!");
239     }
240 
indexOf(java.lang.String str, int fromIndex)241     public int indexOf(java.lang.String str, int fromIndex) {
242         throw new RuntimeException("Stub!");
243     }
244 
indexOf(java.lang.String source, java.lang.String target, int fromIndex)245     private static int indexOf(java.lang.String source, java.lang.String target, int fromIndex) {
246         throw new RuntimeException("Stub!");
247     }
248 
indexOf( char[] source, int sourceOffset, int sourceCount, java.lang.String target, int fromIndex)249     static int indexOf(
250             char[] source,
251             int sourceOffset,
252             int sourceCount,
253             java.lang.String target,
254             int fromIndex) {
255         throw new RuntimeException("Stub!");
256     }
257 
258     @UnsupportedAppUsage
indexOf( char[] source, int sourceOffset, int sourceCount, char[] target, int targetOffset, int targetCount, int fromIndex)259     static int indexOf(
260             char[] source,
261             int sourceOffset,
262             int sourceCount,
263             char[] target,
264             int targetOffset,
265             int targetCount,
266             int fromIndex) {
267         throw new RuntimeException("Stub!");
268     }
269 
lastIndexOf(java.lang.String str)270     public int lastIndexOf(java.lang.String str) {
271         throw new RuntimeException("Stub!");
272     }
273 
lastIndexOf(java.lang.String str, int fromIndex)274     public int lastIndexOf(java.lang.String str, int fromIndex) {
275         throw new RuntimeException("Stub!");
276     }
277 
lastIndexOf( java.lang.String source, java.lang.String target, int fromIndex)278     private static int lastIndexOf(
279             java.lang.String source, java.lang.String target, int fromIndex) {
280         throw new RuntimeException("Stub!");
281     }
282 
lastIndexOf( char[] source, int sourceOffset, int sourceCount, java.lang.String target, int fromIndex)283     static int lastIndexOf(
284             char[] source,
285             int sourceOffset,
286             int sourceCount,
287             java.lang.String target,
288             int fromIndex) {
289         throw new RuntimeException("Stub!");
290     }
291 
292     @UnsupportedAppUsage
lastIndexOf( char[] source, int sourceOffset, int sourceCount, char[] target, int targetOffset, int targetCount, int fromIndex)293     static int lastIndexOf(
294             char[] source,
295             int sourceOffset,
296             int sourceCount,
297             char[] target,
298             int targetOffset,
299             int targetCount,
300             int fromIndex) {
301         throw new RuntimeException("Stub!");
302     }
303 
substring(int beginIndex)304     public java.lang.String substring(int beginIndex) {
305         throw new RuntimeException("Stub!");
306     }
307 
substring(int beginIndex, int endIndex)308     public java.lang.String substring(int beginIndex, int endIndex) {
309         throw new RuntimeException("Stub!");
310     }
311 
fastSubstring(int start, int length)312     private native java.lang.String fastSubstring(int start, int length);
313 
subSequence(int beginIndex, int endIndex)314     public java.lang.CharSequence subSequence(int beginIndex, int endIndex) {
315         throw new RuntimeException("Stub!");
316     }
317 
concat(java.lang.String str)318     public native java.lang.String concat(java.lang.String str);
319 
replace(char oldChar, char newChar)320     public java.lang.String replace(char oldChar, char newChar) {
321         throw new RuntimeException("Stub!");
322     }
323 
doReplace(char oldChar, char newChar)324     private native java.lang.String doReplace(char oldChar, char newChar);
325 
matches(java.lang.String regex)326     public boolean matches(java.lang.String regex) {
327         throw new RuntimeException("Stub!");
328     }
329 
contains(java.lang.CharSequence s)330     public boolean contains(java.lang.CharSequence s) {
331         throw new RuntimeException("Stub!");
332     }
333 
replaceFirst(java.lang.String regex, java.lang.String replacement)334     public java.lang.String replaceFirst(java.lang.String regex, java.lang.String replacement) {
335         throw new RuntimeException("Stub!");
336     }
337 
replaceAll(java.lang.String regex, java.lang.String replacement)338     public java.lang.String replaceAll(java.lang.String regex, java.lang.String replacement) {
339         throw new RuntimeException("Stub!");
340     }
341 
replace( java.lang.CharSequence target, java.lang.CharSequence replacement)342     public java.lang.String replace(
343             java.lang.CharSequence target, java.lang.CharSequence replacement) {
344         throw new RuntimeException("Stub!");
345     }
346 
split(java.lang.String regex, int limit)347     public java.lang.String[] split(java.lang.String regex, int limit) {
348         throw new RuntimeException("Stub!");
349     }
350 
split(java.lang.String regex)351     public java.lang.String[] split(java.lang.String regex) {
352         throw new RuntimeException("Stub!");
353     }
354 
join( java.lang.CharSequence delimiter, java.lang.CharSequence... elements)355     public static java.lang.String join(
356             java.lang.CharSequence delimiter, java.lang.CharSequence... elements) {
357         throw new RuntimeException("Stub!");
358     }
359 
join( java.lang.CharSequence delimiter, java.lang.Iterable<? extends java.lang.CharSequence> elements)360     public static java.lang.String join(
361             java.lang.CharSequence delimiter,
362             java.lang.Iterable<? extends java.lang.CharSequence> elements) {
363         throw new RuntimeException("Stub!");
364     }
365 
toLowerCase(java.util.Locale locale)366     public java.lang.String toLowerCase(java.util.Locale locale) {
367         throw new RuntimeException("Stub!");
368     }
369 
toLowerCase()370     public java.lang.String toLowerCase() {
371         throw new RuntimeException("Stub!");
372     }
373 
toUpperCase(java.util.Locale locale)374     public java.lang.String toUpperCase(java.util.Locale locale) {
375         throw new RuntimeException("Stub!");
376     }
377 
toUpperCase()378     public java.lang.String toUpperCase() {
379         throw new RuntimeException("Stub!");
380     }
381 
trim()382     public java.lang.String trim() {
383         throw new RuntimeException("Stub!");
384     }
385 
toString()386     public java.lang.String toString() {
387         throw new RuntimeException("Stub!");
388     }
389 
toCharArray()390     public native char[] toCharArray();
391 
format(java.lang.String format, java.lang.Object... args)392     public static java.lang.String format(java.lang.String format, java.lang.Object... args) {
393         throw new RuntimeException("Stub!");
394     }
395 
format( java.util.Locale l, java.lang.String format, java.lang.Object... args)396     public static java.lang.String format(
397             java.util.Locale l, java.lang.String format, java.lang.Object... args) {
398         throw new RuntimeException("Stub!");
399     }
400 
valueOf(java.lang.Object obj)401     public static java.lang.String valueOf(java.lang.Object obj) {
402         throw new RuntimeException("Stub!");
403     }
404 
valueOf(char[] data)405     public static java.lang.String valueOf(char[] data) {
406         throw new RuntimeException("Stub!");
407     }
408 
valueOf(char[] data, int offset, int count)409     public static java.lang.String valueOf(char[] data, int offset, int count) {
410         throw new RuntimeException("Stub!");
411     }
412 
copyValueOf(char[] data, int offset, int count)413     public static java.lang.String copyValueOf(char[] data, int offset, int count) {
414         throw new RuntimeException("Stub!");
415     }
416 
copyValueOf(char[] data)417     public static java.lang.String copyValueOf(char[] data) {
418         throw new RuntimeException("Stub!");
419     }
420 
valueOf(boolean b)421     public static java.lang.String valueOf(boolean b) {
422         throw new RuntimeException("Stub!");
423     }
424 
valueOf(char c)425     public static java.lang.String valueOf(char c) {
426         throw new RuntimeException("Stub!");
427     }
428 
valueOf(int i)429     public static java.lang.String valueOf(int i) {
430         throw new RuntimeException("Stub!");
431     }
432 
valueOf(long l)433     public static java.lang.String valueOf(long l) {
434         throw new RuntimeException("Stub!");
435     }
436 
valueOf(float f)437     public static java.lang.String valueOf(float f) {
438         throw new RuntimeException("Stub!");
439     }
440 
valueOf(double d)441     public static java.lang.String valueOf(double d) {
442         throw new RuntimeException("Stub!");
443     }
444 
intern()445     public native java.lang.String intern();
446 
447     public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_ORDER;
448 
449     static {
450         CASE_INSENSITIVE_ORDER = null;
451     }
452 
453     @UnsupportedAppUsage
454     private final int count;
455 
456     {
457         count = 0;
458     }
459 
460     @UnsupportedAppUsage
461     private int hash;
462 
463     private static final java.io.ObjectStreamField[] serialPersistentFields;
464 
465     static {
466         serialPersistentFields = new java.io.ObjectStreamField[0];
467     }
468 
469     private static final long serialVersionUID = -6849794470754667710L; // 0xa0f0a4387a3bb342L
470 
471     @SuppressWarnings({"unchecked", "deprecation", "all"})
472     private static class CaseInsensitiveComparator
473             implements java.util.Comparator<java.lang.String>, java.io.Serializable {
474 
CaseInsensitiveComparator()475         private CaseInsensitiveComparator() {
476             throw new RuntimeException("Stub!");
477         }
478 
compare(java.lang.String s1, java.lang.String s2)479         public int compare(java.lang.String s1, java.lang.String s2) {
480             throw new RuntimeException("Stub!");
481         }
482 
readResolve()483         private java.lang.Object readResolve() {
484             throw new RuntimeException("Stub!");
485         }
486 
487         private static final long serialVersionUID = 8575799808933029326L; // 0x77035c7d5c50e5ceL
488     }
489 }
490