ICU-10646 String -> CharSequence

X-SVN-Rev: 35040
This commit is contained in:
Travis Keep 2014-01-30 20:09:46 +00:00
parent 25459cba6b
commit 0b5902b94d
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ public class SimplePatternFormatter {
* @param pattern The string.
* @return the new SimplePatternFormatter object.
*/
public static SimplePatternFormatter compile(String pattern) {
public static SimplePatternFormatter compile(CharSequence pattern) {
PlaceholdersBuilder placeholdersBuilder = new PlaceholdersBuilder();
PlaceholderIdBuilder idBuilder = new PlaceholderIdBuilder();
StringBuilder newPattern = new StringBuilder();
@ -124,7 +124,7 @@ public class SimplePatternFormatter {
/**
* Formats the given values.
*/
public String format(String... values) {
public String format(CharSequence... values) {
return format(new StringBuilder(), null, values).toString();
}
@ -140,7 +140,7 @@ public class SimplePatternFormatter {
* @return appendTo
*/
public StringBuilder format(
StringBuilder appendTo, int[] offsets, String... values) {
StringBuilder appendTo, int[] offsets, CharSequence... values) {
if (values.length < placeholderCount) {
throw new IllegalArgumentException("Too few values.");
}

View File

@ -628,7 +628,7 @@ public class MeasureFormat extends UFormat {
QuantityFormatter countToFormat = styleToCountToFormat.get(formatWidth);
SimplePatternFormatter formatter = countToFormat.getByVariant(keyword);
int[] offsets = new int[1];
formatter.format(appendTo, offsets, formattedNumber.toString());
formatter.format(appendTo, offsets, formattedNumber);
if (offsets[0] != -1) { // there is a number (may not happen with, say, Arabic dual)
// Fix field position
if (fpos.getBeginIndex() != 0 || fpos.getEndIndex() != 0) {