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