public abstract class UnicodeString extends java.lang.Object implements java.lang.CharSequence, java.lang.Comparable<UnicodeString>
Modifier and Type | Field and Description |
---|---|
static UnicodeString |
EMPTY_STRING |
Constructor and Description |
---|
UnicodeString() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(UnicodeString other)
Compare two unicode strings in codepoint collating sequence
|
static boolean |
containsSurrogatePairs(java.lang.CharSequence value)
Test whether a CharSequence contains Unicode codepoints outside the BMP range
|
boolean |
equals(java.lang.Object obj)
Implementations of UnicodeString can be compared with each other, but not with
other implementations of CharSequence
|
byte[] |
getCodepointCollationKey()
Get the codepoints of the string as a byte array, allocating three
bytes per character.
|
static int |
getMaxWidth(java.lang.CharSequence value)
Get the maximum width of codepoints in this string, in bytes
|
int |
hashCode()
Implementations of UnicodeString can be compared with each other, but not with
other implementations of CharSequence
|
abstract boolean |
isEnd(int pos)
Ask whether a given position is at (or beyond) the end of the string
|
static UnicodeString |
makeUnicodeString(java.lang.CharSequence in)
Make a UnicodeString for a given CharSequence
|
static UnicodeString |
makeUnicodeString(int[] in)
Make a UnicodeString for a given array of codepoints
|
abstract int |
uCharAt(int pos)
Get the character at a specified position
|
abstract int |
uIndexOf(int search,
int start)
Get the first match for a given character
|
abstract int |
uLength()
Get the length of the string, in Unicode codepoints
|
abstract UnicodeString |
uSubstring(int beginIndex,
int endIndex)
Get a substring of this string
|
public static UnicodeString EMPTY_STRING
public static UnicodeString makeUnicodeString(java.lang.CharSequence in)
in
- the input CharSequencepublic static UnicodeString makeUnicodeString(int[] in)
in
- the input CharSequencepublic static boolean containsSurrogatePairs(java.lang.CharSequence value)
value
- the string to be testedpublic static int getMaxWidth(java.lang.CharSequence value)
value
- the string to be examinedpublic abstract UnicodeString uSubstring(int beginIndex, int endIndex)
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)java.lang.IndexOutOfBoundsException
- if the selection goes off the start or end of the string
(this function follows the semantics of String.substring(), not the XPath semantics)public abstract int uIndexOf(int search, int start)
search
- the character to look forstart
- the first position to lookpublic abstract int uCharAt(int pos)
pos
- the index of the required character (counting
codepoints, not 16-bit characters)public abstract int uLength()
public abstract boolean isEnd(int pos)
pos
- the index of the required character (counting
codepoints, not 16-bit characters)public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be comparedpublic int compareTo(UnicodeString other)
compareTo
in interface java.lang.Comparable<UnicodeString>
other
- the object to be comparedpublic final byte[] getCodepointCollationKey()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.