Class UResource.Key
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.UResource.Key
- All Implemented Interfaces:
CharSequence, Cloneable, Comparable<UResource.Key>
- Enclosing class:
UResource
public static final class UResource.Key
extends Object
implements CharSequence, Cloneable, Comparable<UResource.Key>
Represents a resource bundle item's key string.
Avoids object creations as much as possible.
Mutable, not thread-safe.
For permanent storage, use clone() or toString().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int i) clone()Does not clone the byte array.intintcompareTo(UResource.Key other) booleanbooleanendsWith(CharSequence cs) booleaninthashCode()intlength()booleanregionMatches(int start, CharSequence cs) setBytes(byte[] keyBytes, int keyOffset) Mutates this key for a new NUL-terminated resource key string.Mutates this key to be equal to the given string.Mutates this key to an empty resource key string.booleansubSequence(int start, int end) substring(int start) Creates a new Java String for a sub-sequence of this resource key string.substring(int start, int end) Creates a new Java String for a sub-sequence of this resource key string.toString()Creates/caches/returns this resource key string as a Java String.Methods inherited from interface CharSequence
chars, codePoints, getChars, isEmpty
-
Constructor Details
-
Key
public Key()Constructs an empty resource key string object. -
Key
Constructs a resource key object equal to the given string.
-
-
Method Details
-
setBytes
Mutates this key for a new NUL-terminated resource key string. The corresponding ASCII-character bytes are not copied and must not be changed during the lifetime of this key (or until the next setBytes() call) and lifetimes of subSequences created from this key.- Parameters:
keyBytes- new key string byte arraykeyOffset- new key string offset
-
setToEmpty
Mutates this key to an empty resource key string. -
setString
Mutates this key to be equal to the given string. -
clone
-
charAt
public char charAt(int i) - Specified by:
charAtin interfaceCharSequence
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
Creates/caches/returns this resource key string as a Java String.- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
substring
Creates a new Java String for a sub-sequence of this resource key string. -
substring
Creates a new Java String for a sub-sequence of this resource key string. -
equals
-
contentEquals
-
startsWith
-
endsWith
-
regionMatches
- Returns:
- true if the substring of this key starting from the offset contains the same characters as the other sequence.
-
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<UResource.Key>
-
compareTo
-