public final class BMPString extends UnicodeString
EMPTY_STRING
Constructor and Description |
---|
BMPString(java.lang.CharSequence src)
Create a BMPString
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index)
Returns the
char value at the specified index. |
java.lang.CharSequence |
getCharSequence()
Get the underlying CharSequence
|
boolean |
isEnd(int pos)
Ask whether a given position is at (or beyond) the end of the string
|
int |
length()
Returns the length of this character sequence.
|
java.lang.CharSequence |
subSequence(int start,
int end)
Returns a new
CharSequence that is a subsequence of this sequence. |
java.lang.String |
toString() |
int |
uCharAt(int pos)
Get the character at a specified position
|
int |
uIndexOf(int search,
int pos)
Get the first match for a given character
|
int |
uLength()
Get the length of the string, in Unicode codepoints
|
UnicodeString |
uSubstring(int beginIndex,
int endIndex)
Get a substring of this string
|
compareTo, containsSurrogatePairs, equals, getCodepointCollationKey, getMaxWidth, hashCode, makeUnicodeString, makeUnicodeString
public BMPString(java.lang.CharSequence src)
src
- - encapsulated CharSequence.
The client must ensure that this contains no surrogate pairs, and that
it is immutablepublic UnicodeString uSubstring(int beginIndex, int endIndex)
UnicodeString
uSubstring
in class UnicodeString
beginIndex
- the index of the first character to be included (counting
codepoints, not 16-bit characters)endIndex
- the index of the first character to be NOT included (counting
codepoints, not 16-bit characters)public int uCharAt(int pos)
UnicodeString
uCharAt
in class UnicodeString
pos
- the index of the required character (counting
codepoints, not 16-bit characters)public int uIndexOf(int search, int pos)
UnicodeString
uIndexOf
in class UnicodeString
search
- the character to look forpos
- the first position to lookpublic int uLength()
UnicodeString
uLength
in class UnicodeString
public boolean isEnd(int pos)
UnicodeString
isEnd
in class UnicodeString
pos
- the index of the required character (counting
codepoints, not 16-bit characters)public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public java.lang.CharSequence getCharSequence()
public int length()
char
s in the sequence.char
s in this sequencepublic char charAt(int index)
char
value at the specified index. An index ranges from zero
to length() - 1. The first char
value of the sequence is at
index zero, the next at index one, and so on, as for array
indexing.
If the char
value specified by the index is a
surrogate, the surrogate
value is returned.
index
- the index of the char
value to be returnedchar
valuejava.lang.IndexOutOfBoundsException
- if the index argument is negative or not less than
length()public java.lang.CharSequence subSequence(int start, int end)
CharSequence
that is a subsequence of this sequence.
The subsequence starts with the char
value at the specified index and
ends with the char
value at index end - 1. The length
(in char
s) of the
returned sequence is end - start, so if start == end
then an empty sequence is returned. start
- the start index, inclusiveend
- the end index, exclusivejava.lang.IndexOutOfBoundsException
- if start or end are negative,
if end is greater than length(),
or if start is greater than endCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.