import java.util.List;
import com.ibm.icu.impl.Grego;
+import com.ibm.icu.impl.Utility;
import com.ibm.icu.util.Currency.CurrencyUsage;
/**
* Provides information about currencies that is not specific to a locale.
- *
+ *
* A note about currency dates. The CLDR data provides data to the day,
* inclusive. The date information used by CurrencyInfo and CurrencyFilter
- * is represented by milliseconds, which is overly precise. These times are
+ * is represented by milliseconds, which is overly precise. These times are
* in GMT, so queries involving dates should use GMT times, but more generally
* you should avoid relying on time of day in queries.
- *
+ *
* This class is not intended for public subclassing.
- *
+ *
* @stable ICU 4.4
*/
public class CurrencyMetaInfo {
}
/**
- * Returns the unique instance of the currency meta info, or null if
+ * Returns the unique instance of the currency meta info, or null if
* noSubstitute is true and there is no data to support this API.
* @param noSubstitute true if no substitute data should be used
* @return the meta info, or null
* @stable ICU 4.4
*/
public final long to;
-
+
/**
* true if we are filtering only for currencies used as legal tender.
* @internal
this.from = from;
this.to = to;
this.tenderOnly = tenderOnly;
-
+
}
private static final CurrencyFilter ALL = new CurrencyFilter(
public static CurrencyFilter onDateRange(Date from, Date to) {
return ALL.withDateRange(from, to);
}
-
+
/**
* Returns a filter that accepts all currencies in use on the given date.
* @param date the date as milliseconds after Jan 1, 1970
public static CurrencyFilter onDateRange(long from, long to) {
return ALL.withDateRange(from, to);
}
-
+
/**
* Returns a CurrencyFilter for finding currencies that were either once used,
* are used, or will be used as tender.
long toLong = to == null ? Long.MAX_VALUE : to.getTime();
return new CurrencyFilter(this.region, this.currency, fromLong, toLong, this.tenderOnly);
}
-
+
/**
* Returns a copy of this filter that accepts all currencies in use on
* the given date.
public CurrencyFilter withDateRange(long from, long to) {
return new CurrencyFilter(this.region, this.currency, from, to, this.tenderOnly);
}
-
+
/**
* Returns a copy of this filter that filters for currencies that were
* either once used, are used, or will be used as tender.
}
private static boolean equals(String lhs, String rhs) {
- return lhs == rhs || (lhs != null && lhs.equals(rhs));
+ return (Utility.sameObjects(lhs, rhs) ||
+ (lhs != null && lhs.equals(rhs)));
}
}
public final String code;
/**
- * Date on which the currency was first officially used in the region.
- * This is midnight at the start of the first day on which the currency was used, GMT.
+ * Date on which the currency was first officially used in the region.
+ * This is midnight at the start of the first day on which the currency was used, GMT.
* If there is no date, this is Long.MIN_VALUE;
* @stable ICU 4.4
*/
* Date at which the currency stopped being officially used in the region.
* This is one millisecond before midnight at the end of the last day on which the currency was used, GMT.
* If there is no date, this is Long.MAX_VALUE.
- *
+ *
* @stable ICU 4.4
*/
public final long to;
* @stable ICU 49
*/
public final int priority;
-
-
+
+
private final boolean tender;
/**
public CurrencyInfo(String region, String code, long from, long to, int priority) {
this(region, code, from, to, priority, true);
}
-
+
/**
* Constructs a currency info.
- *
+ *
* @internal
* @deprecated This API is ICU internal only.
*/
public String toString() {
return debugString(this);
}
-
+
/**
* Determine whether or not this currency was once used, is used,
* or will be used as tender in this region.
package com.ibm.icu.text;
+import com.ibm.icu.impl.Utility;
+
/**
* <p>
* Standalone utility class providing UTF16 character conversions and indexing conversions.
* <strong>Examples:</strong>
* <p>
* The following examples illustrate use of some of these methods.
- *
+ *
* <pre>
* // iteration forwards: Original
* for (int i = 0; i < s.length(); ++i) {
* char ch = s.charAt(i);
* doSomethingWith(ch);
* }
- *
+ *
* // iteration forwards: Changes for UTF-32
* int ch;
* for (int i = 0; i < s.length(); i += UTF16.getCharCount(ch)) {
* ch = UTF16.charAt(s, i);
* doSomethingWith(ch);
* }
- *
+ *
* // iteration backwards: Original
* for (int i = s.length() - 1; i >= 0; --i) {
* char ch = s.charAt(i);
* doSomethingWith(ch);
* }
- *
+ *
* // iteration backwards: Changes for UTF-32
* int ch;
* for (int i = s.length() - 1; i > 0; i -= UTF16.getCharCount(ch)) {
* doSomethingWith(ch);
* }
* </pre>
- *
+ *
* <strong>Notes:</strong>
* <ul>
* <li> <strong>Naming:</strong> For clarity, High and Low surrogates are called <code>Lead</code>
* compiler doesn't fold static final methods. Since surrogate pairs will form an exceeding small
* percentage of all the text in the world, the singleton case should always be optimized for. </li>
* </ul>
- *
+ *
* @author Mark Davis, with help from Markus Scherer
* @stable ICU 2.1
*/
* Value returned in {@link #bounds(String, int) bounds()}.
* These values are chosen specifically so that it actually represents the position of the
* character [offset16 - (value >> 2), offset16 + (value & 3)]
- *
+ *
* @stable ICU 2.1
*/
public static final int SINGLE_CHAR_BOUNDARY = 1, LEAD_SURROGATE_BOUNDARY = 2,
/**
* The lowest Unicode code point value.
- *
+ *
* @stable ICU 2.1
*/
public static final int CODEPOINT_MIN_VALUE = 0;
/**
* The highest Unicode code point value (scalar value) according to the Unicode Standard.
- *
+ *
* @stable ICU 2.1
*/
public static final int CODEPOINT_MAX_VALUE = 0x10ffff;
/**
* The minimum value for Supplementary code points
- *
+ *
* @stable ICU 2.1
*/
public static final int SUPPLEMENTARY_MIN_VALUE = 0x10000;
/**
* Lead surrogate minimum value
- *
+ *
* @stable ICU 2.1
*/
public static final int LEAD_SURROGATE_MIN_VALUE = 0xD800;
/**
* Trail surrogate minimum value
- *
+ *
* @stable ICU 2.1
*/
public static final int TRAIL_SURROGATE_MIN_VALUE = 0xDC00;
/**
* Lead surrogate maximum value
- *
+ *
* @stable ICU 2.1
*/
public static final int LEAD_SURROGATE_MAX_VALUE = 0xDBFF;
/**
* Trail surrogate maximum value
- *
+ *
* @stable ICU 2.1
*/
public static final int TRAIL_SURROGATE_MAX_VALUE = 0xDFFF;
/**
* Surrogate minimum value
- *
+ *
* @stable ICU 2.1
*/
public static final int SURROGATE_MIN_VALUE = LEAD_SURROGATE_MIN_VALUE;
/**
* Maximum surrogate value
- *
+ *
* @stable ICU 2.1
*/
public static final int SURROGATE_MAX_VALUE = TRAIL_SURROGATE_MAX_VALUE;
* on the return value. If the char retrieved is part of a surrogate pair, its supplementary
* character will be returned. If a complete supplementary character is not found the incomplete
* character will be returned
- *
+ *
* @param source Array of UTF-16 chars
* @param offset16 UTF-16 offset to the start of the character.
* @return UTF-32 value for the UTF-32 value that contains the char at offset16. The boundaries
* on the return value. If the char retrieved is part of a surrogate pair, its supplementary
* character will be returned. If a complete supplementary character is not found the incomplete
* character will be returned
- *
+ *
* @param source Array of UTF-16 chars
* @param offset16 UTF-16 offset to the start of the character.
* @return UTF-32 value for the UTF-32 value that contains the char at offset16. The boundaries
* on the return value. If the char retrieved is part of a surrogate pair, its supplementary
* character will be returned. If a complete supplementary character is not found the incomplete
* character will be returned
- *
+ *
* @param source UTF-16 chars string buffer
* @param offset16 UTF-16 offset to the start of the character.
* @return UTF-32 value for the UTF-32 value that contains the char at offset16. The boundaries
* on the return value. If the char retrieved is part of a surrogate pair, its supplementary
* character will be returned. If a complete supplementary character is not found the incomplete
* character will be returned
- *
+ *
* @param source Array of UTF-16 chars
* @param start Offset to substring in the source array for analyzing
* @param limit Offset to substring in the source array for analyzing
* on the return value. If the char retrieved is part of a surrogate pair, its supplementary
* character will be returned. If a complete supplementary character is not found the incomplete
* character will be returned
- *
+ *
* @param source UTF-16 chars string buffer
* @param offset16 UTF-16 offset to the start of the character.
* @return UTF-32 value for the UTF-32 value that contains the char at offset16. The boundaries
* Determines how many chars this char32 requires. If a validity check is required, use <code>
* <a href="../lang/UCharacter.html#isLegal(char)">isLegal()</a></code>
* on char32 before calling.
- *
+ *
* @param char32 The input codepoint.
* @return 2 if is in supplementary space, otherwise 1.
* @stable ICU 2.1
/**
* Returns the type of the boundaries around the char at offset16. Used for random access.
- *
+ *
* @param source Text to analyse
* @param offset16 UTF-16 offset
* @return
/**
* Returns the type of the boundaries around the char at offset16. Used for random access.
- *
+ *
* @param source String buffer to analyse
* @param offset16 UTF16 offset
* @return
* Returns the type of the boundaries around the char at offset16. Used for random access. Note
* that the boundaries are determined with respect to the subarray, hence the char array
* {0xD800, 0xDC00} has the result SINGLE_CHAR_BOUNDARY for start = offset16 = 0 and limit = 1.
- *
+ *
* @param source Char array to analyse
* @param start Offset to substring in the source array for analyzing
* @param limit Offset to substring in the source array for analyzing
/**
* Determines whether the code value is a surrogate.
- *
+ *
* @param char16 The input character.
* @return true If the input character is a surrogate.
* @stable ICU 2.1
/**
* Determines whether the character is a trail surrogate.
- *
+ *
* @param char16 The input character.
* @return true If the input character is a trail surrogate.
* @stable ICU 2.1
/**
* Determines whether the character is a lead surrogate.
- *
+ *
* @param char16 The input character.
* @return true If the input character is a lead surrogate
* @stable ICU 2.1
* Returns the lead surrogate. If a validity check is required, use
* <code><a href="../lang/UCharacter.html#isLegal(char)">isLegal()</a></code> on char32
* before calling.
- *
+ *
* @param char32 The input character.
* @return lead surrogate if the getCharCount(ch) is 2; <br>
* and 0 otherwise (note: 0 is not a valid lead surrogate).
* Returns the trail surrogate. If a validity check is required, use
* <code><a href="../lang/UCharacter.html#isLegal(char)">isLegal()</a></code> on char32
* before calling.
- *
+ *
* @param char32 The input character.
* @return the trail surrogate if the getCharCount(ch) is 2; <br>
* otherwise the character itself
* Convenience method corresponding to String.valueOf(char). Returns a one or two char string
* containing the UTF-32 value in UTF16 format. If a validity check is required, use
* {@link com.ibm.icu.lang.UCharacter#isLegal(int)} on char32 before calling.
- *
+ *
* @param char32 The input character.
* @return string value of char32 in UTF16 format
* @exception IllegalArgumentException Thrown if char32 is a invalid codepoint.
* required, use {@link com.ibm.icu.lang.UCharacter#isLegal(int)} on the
* codepoint at offset16 before calling. The result returned will be a newly created String
* obtained by calling source.substring(..) with the appropriate indexes.
- *
+ *
* @param source The input string.
* @param offset16 The UTF16 index to the codepoint in source
* @return string value of char32 in UTF16 format
* is required, use {@link com.ibm.icu.lang.UCharacter#isLegal(int)} on
* the codepoint at offset16 before calling. The result returned will be a newly created String
* obtained by calling source.substring(..) with the appropriate indexes.
- *
+ *
* @param source The input string buffer.
* @param offset16 The UTF16 index to the codepoint in source
* @return string value of char32 in UTF16 format
* {@link com.ibm.icu.lang.UCharacter#isLegal(int)} on the codepoint at
* offset16 before calling. The result returned will be a newly created String containing the
* relevant characters.
- *
+ *
* @param source The input char array.
* @param start Start index of the subarray
* @param limit End index of the subarray
/**
* Returns the UTF-16 offset that corresponds to a UTF-32 offset. Used for random access. See
* the {@link UTF16 class description} for notes on roundtripping.
- *
+ *
* @param source The UTF-16 string
* @param offset32 UTF-32 offset
* @return UTF-16 offset
/**
* Returns the UTF-16 offset that corresponds to a UTF-32 offset. Used for random access. See
* the {@link UTF16 class description} for notes on roundtripping.
- *
+ *
* @param source The UTF-16 string buffer
* @param offset32 UTF-32 offset
* @return UTF-16 offset
/**
* Returns the UTF-16 offset that corresponds to a UTF-32 offset. Used for random access. See
* the {@link UTF16 class description} for notes on roundtripping.
- *
+ *
* @param source The UTF-16 char array whose substring is to be analysed
* @param start Offset of the substring to be analysed
* @param limit Offset of the substring to be analysed
* of the <strong>lead</strong> of the pair is returned. </i>
* <p>
* To find the UTF-32 length of a string, use:
- *
+ *
* <pre>
* len32 = countCodePoint(source, source.length());
* </pre>
- *
+ *
* @param source Text to analyse
* @param offset16 UTF-16 offset < source text length.
* @return UTF-32 offset
* of the <strong>lead</strong> of the pair is returned. </i>
* <p>
* To find the UTF-32 length of a string, use:
- *
+ *
* <pre>
* len32 = countCodePoint(source);
* </pre>
* of the <strong>lead</strong> of the pair is returned. </i>
* <p>
* To find the UTF-32 length of a substring, use:
- *
+ *
* <pre>
* len32 = countCodePoint(source, start, limit);
* </pre>
* Append a single UTF-32 value to the end of a StringBuffer. If a validity check is required,
* use {@link com.ibm.icu.lang.UCharacter#isLegal(int)} on char32 before
* calling.
- *
+ *
* @param target The buffer to append to
* @param char32 Value to append.
* @return the updated StringBuffer
/**
* Cover JDK 1.5 APIs. Append the code point to the buffer and return the buffer as a
* convenience.
- *
+ *
* @param target The buffer to append to
* @param cp The code point to append
* @return the updated StringBuffer
/**
* Adds a codepoint to offset16 position of the argument char array.
- *
+ *
* @param target Char array to be append with the new code point
* @param limit UTF16 offset which the codepoint will be appended.
* @param char32 Code point to be appended
/**
* Number of codepoints in a UTF16 String
- *
+ *
* @param source UTF16 string
* @return number of codepoint in string
* @stable ICU 2.1
/**
* Number of codepoints in a UTF16 String buffer
- *
+ *
* @param source UTF16 string buffer
* @return number of codepoint in string
* @stable ICU 2.1
/**
* Number of codepoints in a UTF16 char array substring
- *
+ *
* @param source UTF16 char array
* @param start Offset of the substring
* @param limit Offset of the substring
/**
* Set a code point into a UTF16 position. Adjusts target according if we are replacing a
* non-supplementary codepoint with a supplementary and vice versa.
- *
+ *
* @param target Stringbuffer
* @param offset16 UTF16 position to insert into
* @param char32 Code point
/**
* Set a code point into a UTF16 position in a char array. Adjusts target according if we are
* replacing a non-supplementary codepoint with a supplementary and vice versa.
- *
+ *
* @param target char array
* @param limit numbers of valid chars in target, different from target.length. limit counts the
* number of chars in target that represents a string, not the size of array target.
/**
* Shifts offset16 by the argument number of codepoints
- *
+ *
* @param source string
* @param offset16 UTF16 position to shift
* @param shift32 number of codepoints to shift
/**
* Shifts offset16 by the argument number of codepoints
- *
+ *
* @param source String buffer
* @param offset16 UTF16 position to shift
* @param shift32 Number of codepoints to shift
/**
* Shifts offset16 by the argument number of codepoints within a subarray.
- *
+ *
* @param source Char array
* @param start Position of the subarray to be performed on
* @param limit Position of the subarray to be performed on
* <p>
* The offset argument must be greater than or equal to 0, and less than or equal to the length
* of source.
- *
+ *
* @param target String buffer to insert to
* @param offset16 Offset which char32 will be inserted in
* @param char32 Codepoint to be inserted
* </p>
* <p>
* The offset argument must be greater than or equal to 0, and less than or equal to the limit.
- *
+ *
* @param target Char array to insert to
* @param limit End index of the char array, limit <= target.length
* @param offset16 Offset which char32 will be inserted in
/**
* Removes the codepoint at the specified position in this target (shortening target by 1
* character if the codepoint is a non-supplementary, 2 otherwise).
- *
+ *
* @param target String buffer to remove codepoint from
* @param offset16 Offset which the codepoint will be removed
* @return a reference to target
/**
* Removes the codepoint at the specified position in this target (shortening target by 1
* character if the codepoint is a non-supplementary, 2 otherwise).
- *
+ *
* @param target String buffer to remove codepoint from
* @param limit End index of the char array, limit <= target.length
* @param offset16 Offset which the codepoint will be removed
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param char32 Codepoint to search for
* @return the index of the first occurrence of the codepoint in the argument Unicode string, or
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param str UTF16 format Unicode string to search for
* @return the index of the first occurrence of the codepoint in the argument Unicode string, or
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param char32 Codepoint to search for
* @param fromIndex The index to start the search from.
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param str UTF16 format Unicode string to search for
* @param fromIndex The index to start the search from.
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param char32 Codepoint to search for
* @return the index of the last occurrence of the codepoint in source, or -1 if the codepoint
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param str UTF16 format Unicode string to search for
* @return the index of the last occurrence of the codepoint in source, or -1 if the codepoint
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param char32 Codepoint to search for
* @param fromIndex the index to start the search from. There is no restriction on the value of
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string that will be searched
* @param str UTF16 format Unicode string to search for
* @param fromIndex the index to start the search from. There is no restriction on the value of
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string which the codepoint replacements will be based on.
* @param oldChar32 Non-zero old codepoint to be replaced.
* @param newChar32 The new codepoint to replace oldChar32
* </p>
* Note this method is provided as support to jdk 1.3, which does not support supplementary
* characters to its fullest.
- *
+ *
* @param source UTF16 format Unicode string which the replacements will be based on.
* @param oldStr Non-zero-length string to be replaced.
* @param newStr The new string to replace oldStr
* Examples:<br>
* UTF16.reverse(new StringBuffer( "Supplementary characters \ud800\udc00\ud801\udc01"))<br>
* returns "\ud801\udc01\ud800\udc00 sretcarahc yratnemelppuS".
- *
+ *
* @param source The source StringBuffer that contains UTF16 format Unicode string to be reversed
* @return a modified source with reversed UTF16 format Unicode string.
* @stable ICU 2.6
* certain range, and never needs to count more than 'number + 1' code points. Logically
* equivalent to (countCodePoint(s) > number). A Unicode code point may occupy either one or two
* code units.
- *
+ *
* @param source The input string.
* @param number The number of code points in the string is compared against the 'number'
* parameter.
* needs to count more than 'number + 1' code points. Logically equivalent to
* (countCodePoint(source, start, limit) > number). A Unicode code point may occupy either one
* or two code units.
- *
+ *
* @param source Array of UTF-16 chars
* @param start Offset to substring in the source array for analyzing
* @param limit Offset to substring in the source array for analyzing
* length is within a certain range, and never needs to count more than 'number + 1' code
* points. Logically equivalent to (countCodePoint(s) > number). A Unicode code point may
* occupy either one or two code units.
- *
+ *
* @param source The input string buffer.
* @param number The number of code points in the string buffer is compared against the 'number'
* parameter.
/**
* Cover JDK 1.5 API. Create a String from an array of codePoints.
- *
+ *
* @param codePoints The code array
* @param offset The start of the text in the code point array
* @param count The number of code points
* supplementary code points because they are stored as pairs of surrogates which are at
* \ud800..\udfff.
* </p>
- *
+ *
* @see #FOLD_CASE_DEFAULT
* @see #FOLD_CASE_EXCLUDE_SPECIAL_I
* @stable ICU 2.1
/**
* Default constructor that does code unit comparison and case sensitive comparison.
- *
+ *
* @stable ICU 2.1
*/
public StringComparator() {
/**
* Constructor that does comparison based on the argument options.
- *
+ *
* @param codepointcompare Flag to indicate true for code point comparison or false for code unit
* comparison.
* @param ignorecase False for case sensitive comparison, true for case-insensitive comparison
*
* <p>Comparison is case insensitive, strings are folded using default mappings defined in
* Unicode data file CaseFolding.txt, before comparison.
- *
+ *
* @stable ICU 2.4
*/
public static final int FOLD_CASE_DEFAULT = 0;
*
* <p>Comparison is case insensitive, strings are folded using modified mappings defined in
* Unicode data file CaseFolding.txt, before comparison.
- *
+ *
* @stable ICU 2.4
* @see com.ibm.icu.lang.UCharacter#FOLD_CASE_EXCLUDE_SPECIAL_I
*/
/**
* Sets the comparison mode to code point compare if flag is true. Otherwise comparison mode
* is set to code unit compare
- *
+ *
* @param flag True for code point compare, false for code unit compare
* @stable ICU 2.4
*/
/**
* Sets the Comparator to case-insensitive comparison mode if argument is true, otherwise
* case sensitive comparison mode if set to false.
- *
+ *
* @param ignorecase True for case-insitive comparison, false for case sensitive comparison
* @param foldcaseoption FOLD_CASE_DEFAULT or FOLD_CASE_EXCLUDE_SPECIAL_I. This option is used only
* when ignorecase is set to true. If ignorecase is false, this option is
/**
* Checks if the comparison mode is code point compare.
- *
+ *
* @return true for code point compare, false for code unit compare
* @stable ICU 2.4
*/
/**
* Checks if Comparator is in the case insensitive mode.
- *
+ *
* @return true if Comparator performs case insensitive comparison, false otherwise
* @stable ICU 2.4
*/
/**
* Gets the fold case options set in Comparator to be used with case insensitive comparison.
- *
+ *
* @return either FOLD_CASE_DEFAULT or FOLD_CASE_EXCLUDE_SPECIAL_I
* @see #FOLD_CASE_DEFAULT
* @see #FOLD_CASE_EXCLUDE_SPECIAL_I
/**
* Compare two strings depending on the options selected during construction.
- *
+ *
* @param a first source string.
* @param b second source string.
* @return 0 returned if a == b. If a < b, a negative value is returned. Otherwise if a > b,
* @exception ClassCastException thrown when either a or b is not a String object
* @stable ICU 4.4
*/
+ @Override
public int compare(String a, String b) {
- if (a == b) {
+ if (Utility.sameObjects(a, b)) {
return 0;
}
if (a == null) {
/**
* Compares case insensitive. This is a direct port of ICU4C, to make maintainence life
* easier.
- *
+ *
* @param s1
* first string to compare
* @param s2
/**
* Compares case sensitive. This is a direct port of ICU4C, to make maintainence life
* easier.
- *
+ *
* @param s1
* first string to compare
* @param s2
}
// at this point, len = 2
- int cp = Character.codePointAt(s, 0);
+ int cp = Character.codePointAt(s, 0);
if (cp > 0xFFFF) { // is surrogate pair
return cp;
}
* <p>
* The result is a string whose length is 1 for non-supplementary code points, 2 otherwise.
* </p>
- *
+ *
* @param ch
* code point
* @return string representation of the code point