diff options
author | 2014-03-25 21:59:53 +0900 | |
---|---|---|
committer | 2014-04-02 17:57:36 +0900 | |
commit | 3285b68c97d966d86c08aeb837e5bf5633981357 (patch) | |
tree | a91cbe67acd4aac22df5a30d53699412b613b6eb /java/src/com/android/inputmethod/latin/utils | |
parent | 543fea98a4deebbbb34ea2ce018da971160dfdb4 (diff) | |
download | latinime-3285b68c97d966d86c08aeb837e5bf5633981357.tar.gz latinime-3285b68c97d966d86c08aeb837e5bf5633981357.tar.xz latinime-3285b68c97d966d86c08aeb837e5bf5633981357.zip |
[CB17] Remove a member.
Bug: 13406701
Change-Id: I2e271f637f6b529a4191a7adc5cdfa5af437761b
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/StringUtils.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/StringUtils.java b/java/src/com/android/inputmethod/latin/utils/StringUtils.java index b9d526b5f..accbc8b7b 100644 --- a/java/src/com/android/inputmethod/latin/utils/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/StringUtils.java @@ -172,28 +172,29 @@ public final class StringUtils { private static final int[] EMPTY_CODEPOINTS = {}; - public static int[] toCodePointArray(final String string) { - return toCodePointArray(string, 0, string.length()); + public static int[] toCodePointArray(final CharSequence charSequence) { + return toCodePointArray(charSequence, 0, charSequence.length()); } /** * Converts a range of a string to an array of code points. - * @param string the source string. + * @param charSequence the source string. * @param startIndex the start index inside the string in java chars, inclusive. * @param endIndex the end index inside the string in java chars, exclusive. * @return a new array of code points. At most endIndex - startIndex, but possibly less. */ - public static int[] toCodePointArray(final String string, + public static int[] toCodePointArray(final CharSequence charSequence, final int startIndex, final int endIndex) { - final int length = string.length(); + final int length = charSequence.length(); if (length <= 0) { return EMPTY_CODEPOINTS; } - final int[] codePoints = new int[string.codePointCount(startIndex, endIndex)]; + final int[] codePoints = + new int[Character.codePointCount(charSequence, startIndex, endIndex)]; int destIndex = 0; for (int index = startIndex; index < endIndex; - index = string.offsetByCodePoints(index, 1)) { - codePoints[destIndex] = string.codePointAt(index); + index = Character.offsetByCodePoints(charSequence, index, 1)) { + codePoints[destIndex] = Character.codePointAt(charSequence, index); destIndex++; } return codePoints; |