ICU-10646 String -> CharSequence
X-SVN-Rev: 35040
This commit is contained in:
parent
25459cba6b
commit
0b5902b94d
@ -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.");
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user