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
28 package java.lang;
29
30 import java.nio.charset.Charset;
31 import java.io.UnsupportedEncodingException;
32 import java.util.regex.Pattern;
33 import java.util.regex.PatternSyntaxException;
34 import java.util.StringJoiner;
35 import java.util.Locale;
36 import java.util.Formatter;
37 import java.util.Comparator;
38
39 @SuppressWarnings({"unchecked", "deprecation", "all"})
40 public final class String implements java.io.Serializable, java.lang.Comparable<java.lang.String>, java.lang.CharSequence {
41
String()42 public String() { throw new RuntimeException("Stub!"); }
43
String(@ibcore.util.NonNull java.lang.String original)44 public String(@libcore.util.NonNull java.lang.String original) { throw new RuntimeException("Stub!"); }
45
String(char[] value)46 public String(char[] value) { throw new RuntimeException("Stub!"); }
47
String(char[] value, int offset, int count)48 public String(char[] value, int offset, int count) { throw new RuntimeException("Stub!"); }
49
String(int[] codePoints, int offset, int count)50 public String(int[] codePoints, int offset, int count) { throw new RuntimeException("Stub!"); }
51
String(byte[] ascii, int hibyte, int offset, int count)52 @Deprecated public String(byte[] ascii, int hibyte, int offset, int count) { throw new RuntimeException("Stub!"); }
53
String(byte[] ascii, int hibyte)54 @Deprecated public String(byte[] ascii, int hibyte) { throw new RuntimeException("Stub!"); }
55
String(byte[] bytes, int offset, int length, @libcore.util.NonNull java.lang.String charsetName)56 public String(byte[] bytes, int offset, int length, @libcore.util.NonNull java.lang.String charsetName) throws java.io.UnsupportedEncodingException { throw new RuntimeException("Stub!"); }
57
String(byte[] bytes, int offset, int length, @libcore.util.NonNull java.nio.charset.Charset charset)58 public String(byte[] bytes, int offset, int length, @libcore.util.NonNull java.nio.charset.Charset charset) { throw new RuntimeException("Stub!"); }
59
String(byte[] bytes, @libcore.util.NonNull java.lang.String charsetName)60 public String(byte[] bytes, @libcore.util.NonNull java.lang.String charsetName) throws java.io.UnsupportedEncodingException { throw new RuntimeException("Stub!"); }
61
String(byte[] bytes, @libcore.util.NonNull java.nio.charset.Charset charset)62 public String(byte[] bytes, @libcore.util.NonNull java.nio.charset.Charset charset) { throw new RuntimeException("Stub!"); }
63
String(byte[] bytes, int offset, int length)64 public String(byte[] bytes, int offset, int length) { throw new RuntimeException("Stub!"); }
65
String(byte[] bytes)66 public String(byte[] bytes) { throw new RuntimeException("Stub!"); }
67
String(@ibcore.util.NonNull java.lang.StringBuffer buffer)68 public String(@libcore.util.NonNull java.lang.StringBuffer buffer) { throw new RuntimeException("Stub!"); }
69
String(@ibcore.util.NonNull java.lang.StringBuilder builder)70 public String(@libcore.util.NonNull java.lang.StringBuilder builder) { throw new RuntimeException("Stub!"); }
71
length()72 public int length() { throw new RuntimeException("Stub!"); }
73
isEmpty()74 public boolean isEmpty() { throw new RuntimeException("Stub!"); }
75
charAt(int index)76 public native char charAt(int index);
77
codePointAt(int index)78 public int codePointAt(int index) { throw new RuntimeException("Stub!"); }
79
codePointBefore(int index)80 public int codePointBefore(int index) { throw new RuntimeException("Stub!"); }
81
codePointCount(int beginIndex, int endIndex)82 public int codePointCount(int beginIndex, int endIndex) { throw new RuntimeException("Stub!"); }
83
offsetByCodePoints(int index, int codePointOffset)84 public int offsetByCodePoints(int index, int codePointOffset) { throw new RuntimeException("Stub!"); }
85
getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)86 public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) { throw new RuntimeException("Stub!"); }
87
getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)88 @Deprecated public void getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin) { throw new RuntimeException("Stub!"); }
89
getBytes(@ibcore.util.NonNull java.lang.String charsetName)90 public byte[] getBytes(@libcore.util.NonNull java.lang.String charsetName) throws java.io.UnsupportedEncodingException { throw new RuntimeException("Stub!"); }
91
getBytes(@ibcore.util.NonNull java.nio.charset.Charset charset)92 public byte[] getBytes(@libcore.util.NonNull java.nio.charset.Charset charset) { throw new RuntimeException("Stub!"); }
93
getBytes()94 public byte[] getBytes() { throw new RuntimeException("Stub!"); }
95
equals(@ibcore.util.Nullable java.lang.Object anObject)96 public boolean equals(@libcore.util.Nullable java.lang.Object anObject) { throw new RuntimeException("Stub!"); }
97
contentEquals(@ibcore.util.NonNull java.lang.StringBuffer sb)98 public boolean contentEquals(@libcore.util.NonNull java.lang.StringBuffer sb) { throw new RuntimeException("Stub!"); }
99
contentEquals(@ibcore.util.NonNull java.lang.CharSequence cs)100 public boolean contentEquals(@libcore.util.NonNull java.lang.CharSequence cs) { throw new RuntimeException("Stub!"); }
101
equalsIgnoreCase(@ibcore.util.Nullable java.lang.String anotherString)102 public boolean equalsIgnoreCase(@libcore.util.Nullable java.lang.String anotherString) { throw new RuntimeException("Stub!"); }
103
compareTo(@ibcore.util.NonNull java.lang.String anotherString)104 public native int compareTo(@libcore.util.NonNull java.lang.String anotherString);
105
compareToIgnoreCase(@ibcore.util.NonNull java.lang.String str)106 public int compareToIgnoreCase(@libcore.util.NonNull java.lang.String str) { throw new RuntimeException("Stub!"); }
107
regionMatches(int toffset, @libcore.util.NonNull java.lang.String other, int ooffset, int len)108 public boolean regionMatches(int toffset, @libcore.util.NonNull java.lang.String other, int ooffset, int len) { throw new RuntimeException("Stub!"); }
109
regionMatches(boolean ignoreCase, int toffset, @libcore.util.NonNull java.lang.String other, int ooffset, int len)110 public boolean regionMatches(boolean ignoreCase, int toffset, @libcore.util.NonNull java.lang.String other, int ooffset, int len) { throw new RuntimeException("Stub!"); }
111
startsWith(@ibcore.util.NonNull java.lang.String prefix, int toffset)112 public boolean startsWith(@libcore.util.NonNull java.lang.String prefix, int toffset) { throw new RuntimeException("Stub!"); }
113
startsWith(@ibcore.util.NonNull java.lang.String prefix)114 public boolean startsWith(@libcore.util.NonNull java.lang.String prefix) { throw new RuntimeException("Stub!"); }
115
endsWith(@ibcore.util.NonNull java.lang.String suffix)116 public boolean endsWith(@libcore.util.NonNull java.lang.String suffix) { throw new RuntimeException("Stub!"); }
117
hashCode()118 public int hashCode() { throw new RuntimeException("Stub!"); }
119
indexOf(int ch)120 public int indexOf(int ch) { throw new RuntimeException("Stub!"); }
121
indexOf(int ch, int fromIndex)122 public int indexOf(int ch, int fromIndex) { throw new RuntimeException("Stub!"); }
123
lastIndexOf(int ch)124 public int lastIndexOf(int ch) { throw new RuntimeException("Stub!"); }
125
lastIndexOf(int ch, int fromIndex)126 public int lastIndexOf(int ch, int fromIndex) { throw new RuntimeException("Stub!"); }
127
indexOf(@ibcore.util.NonNull java.lang.String str)128 public int indexOf(@libcore.util.NonNull java.lang.String str) { throw new RuntimeException("Stub!"); }
129
indexOf(@ibcore.util.NonNull java.lang.String str, int fromIndex)130 public int indexOf(@libcore.util.NonNull java.lang.String str, int fromIndex) { throw new RuntimeException("Stub!"); }
131
lastIndexOf(@ibcore.util.NonNull java.lang.String str)132 public int lastIndexOf(@libcore.util.NonNull java.lang.String str) { throw new RuntimeException("Stub!"); }
133
lastIndexOf(@ibcore.util.NonNull java.lang.String str, int fromIndex)134 public int lastIndexOf(@libcore.util.NonNull java.lang.String str, int fromIndex) { throw new RuntimeException("Stub!"); }
135
substring(int beginIndex)136 @libcore.util.NonNull public java.lang.String substring(int beginIndex) { throw new RuntimeException("Stub!"); }
137
substring(int beginIndex, int endIndex)138 @libcore.util.NonNull public java.lang.String substring(int beginIndex, int endIndex) { throw new RuntimeException("Stub!"); }
139
subSequence(int beginIndex, int endIndex)140 @libcore.util.NonNull public java.lang.CharSequence subSequence(int beginIndex, int endIndex) { throw new RuntimeException("Stub!"); }
141
concat(@ibcore.util.NonNull java.lang.String str)142 @libcore.util.NonNull public native java.lang.String concat(@libcore.util.NonNull java.lang.String str);
143
replace(char oldChar, char newChar)144 @libcore.util.NonNull public java.lang.String replace(char oldChar, char newChar) { throw new RuntimeException("Stub!"); }
145
matches(@ibcore.util.NonNull java.lang.String regex)146 public boolean matches(@libcore.util.NonNull java.lang.String regex) { throw new RuntimeException("Stub!"); }
147
contains(@ibcore.util.NonNull java.lang.CharSequence s)148 public boolean contains(@libcore.util.NonNull java.lang.CharSequence s) { throw new RuntimeException("Stub!"); }
149
replaceFirst(@ibcore.util.NonNull java.lang.String regex, @libcore.util.NonNull java.lang.String replacement)150 @libcore.util.NonNull public java.lang.String replaceFirst(@libcore.util.NonNull java.lang.String regex, @libcore.util.NonNull java.lang.String replacement) { throw new RuntimeException("Stub!"); }
151
replaceAll(@ibcore.util.NonNull java.lang.String regex, @libcore.util.NonNull java.lang.String replacement)152 @libcore.util.NonNull public java.lang.String replaceAll(@libcore.util.NonNull java.lang.String regex, @libcore.util.NonNull java.lang.String replacement) { throw new RuntimeException("Stub!"); }
153
replace(@ibcore.util.NonNull java.lang.CharSequence target, @libcore.util.NonNull java.lang.CharSequence replacement)154 @libcore.util.NonNull public java.lang.String replace(@libcore.util.NonNull java.lang.CharSequence target, @libcore.util.NonNull java.lang.CharSequence replacement) { throw new RuntimeException("Stub!"); }
155
split(@ibcore.util.NonNull java.lang.String regex, int limit)156 public java.lang.@libcore.util.NonNull String @libcore.util.NonNull [] split(@libcore.util.NonNull java.lang.String regex, int limit) { throw new RuntimeException("Stub!"); }
157
split(@ibcore.util.NonNull java.lang.String regex)158 public java.lang.@libcore.util.NonNull String @libcore.util.NonNull [] split(@libcore.util.NonNull java.lang.String regex) { throw new RuntimeException("Stub!"); }
159
join(@ibcore.util.NonNull java.lang.CharSequence delimiter, java.lang.@libcore.util.NonNull CharSequence @libcore.util.Nullable ... elements)160 @libcore.util.NonNull public static java.lang.String join(@libcore.util.NonNull java.lang.CharSequence delimiter, java.lang.@libcore.util.NonNull CharSequence @libcore.util.Nullable ... elements) { throw new RuntimeException("Stub!"); }
161
join(@ibcore.util.NonNull java.lang.CharSequence delimiter, @libcore.util.NonNull java.lang.Iterable<? extends @libcore.util.Nullable java.lang.CharSequence> elements)162 @libcore.util.NonNull public static java.lang.String join(@libcore.util.NonNull java.lang.CharSequence delimiter, @libcore.util.NonNull java.lang.Iterable<? extends @libcore.util.Nullable java.lang.CharSequence> elements) { throw new RuntimeException("Stub!"); }
163
toLowerCase(@ibcore.util.NonNull java.util.Locale locale)164 @libcore.util.NonNull public java.lang.String toLowerCase(@libcore.util.NonNull java.util.Locale locale) { throw new RuntimeException("Stub!"); }
165
toLowerCase()166 @libcore.util.NonNull public java.lang.String toLowerCase() { throw new RuntimeException("Stub!"); }
167
toUpperCase(@ibcore.util.NonNull java.util.Locale locale)168 @libcore.util.NonNull public java.lang.String toUpperCase(@libcore.util.NonNull java.util.Locale locale) { throw new RuntimeException("Stub!"); }
169
toUpperCase()170 @libcore.util.NonNull public java.lang.String toUpperCase() { throw new RuntimeException("Stub!"); }
171
trim()172 @libcore.util.NonNull public java.lang.String trim() { throw new RuntimeException("Stub!"); }
173
toString()174 @libcore.util.NonNull public java.lang.String toString() { throw new RuntimeException("Stub!"); }
175
toCharArray()176 public native char[] toCharArray();
177
format(@ibcore.util.NonNull java.lang.String format, java.lang.@libcore.util.Nullable Object @libcore.util.NonNull ... args)178 @libcore.util.NonNull public static java.lang.String format(@libcore.util.NonNull java.lang.String format, java.lang.@libcore.util.Nullable Object @libcore.util.NonNull ... args) { throw new RuntimeException("Stub!"); }
179
format(@ibcore.util.NonNull java.util.Locale l, @libcore.util.NonNull java.lang.String format, java.lang.@libcore.util.Nullable Object @libcore.util.NonNull ... args)180 @libcore.util.NonNull public static java.lang.String format(@libcore.util.NonNull java.util.Locale l, @libcore.util.NonNull java.lang.String format, java.lang.@libcore.util.Nullable Object @libcore.util.NonNull ... args) { throw new RuntimeException("Stub!"); }
181
valueOf(@ibcore.util.Nullable java.lang.Object obj)182 @libcore.util.NonNull public static java.lang.String valueOf(@libcore.util.Nullable java.lang.Object obj) { throw new RuntimeException("Stub!"); }
183
valueOf(char[] data)184 @libcore.util.NonNull public static java.lang.String valueOf(char[] data) { throw new RuntimeException("Stub!"); }
185
valueOf(char[] data, int offset, int count)186 @libcore.util.NonNull public static java.lang.String valueOf(char[] data, int offset, int count) { throw new RuntimeException("Stub!"); }
187
copyValueOf(char[] data, int offset, int count)188 @libcore.util.NonNull public static java.lang.String copyValueOf(char[] data, int offset, int count) { throw new RuntimeException("Stub!"); }
189
copyValueOf(char[] data)190 @libcore.util.NonNull public static java.lang.String copyValueOf(char[] data) { throw new RuntimeException("Stub!"); }
191
valueOf(boolean b)192 @libcore.util.NonNull public static java.lang.String valueOf(boolean b) { throw new RuntimeException("Stub!"); }
193
valueOf(char c)194 @libcore.util.NonNull public static java.lang.String valueOf(char c) { throw new RuntimeException("Stub!"); }
195
valueOf(int i)196 @libcore.util.NonNull public static java.lang.String valueOf(int i) { throw new RuntimeException("Stub!"); }
197
valueOf(long l)198 @libcore.util.NonNull public static java.lang.String valueOf(long l) { throw new RuntimeException("Stub!"); }
199
valueOf(float f)200 @libcore.util.NonNull public static java.lang.String valueOf(float f) { throw new RuntimeException("Stub!"); }
201
valueOf(double d)202 @libcore.util.NonNull public static java.lang.String valueOf(double d) { throw new RuntimeException("Stub!"); }
203
intern()204 @libcore.util.NonNull public native java.lang.String intern();
205
206 public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_ORDER;
207 static { CASE_INSENSITIVE_ORDER = null; }
208 }
209