script-astra/Android/Sdk/sources/android-35/android/icu/message2/StringView.java

40 lines
860 B
Java
Raw Permalink Normal View History

2025-01-20 15:15:20 +00:00
/* GENERATED SOURCE. DO NOT MODIFY. */
// © 2024 and later: Unicode, Inc. and others.
// License & terms of use: https://www.unicode.org/copyright.html
package android.icu.message2;
class StringView implements CharSequence {
final int offset;
final String text;
StringView(String text, int offset) {
this.offset = offset;
this.text = text;
}
StringView(String text) {
this(text, 0);
}
@Override
public int length() {
return text.length() - offset;
}
@Override
public char charAt(int index) {
return text.charAt(index + offset);
}
@Override
public CharSequence subSequence(int start, int end) {
return text.subSequence(start + offset, end + offset);
}
@Override
public String toString() {
return text.substring(offset);
}
}