public final class ListFormatter extends Object
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
format(Object... items) |
Format a list of objects.
|
String |
format(Collection<?> items) |
Format a collection of objects.
|
static ListFormatter |
getInstance() |
Create a list formatter that is appropriate for the default FORMAT locale.
|
static ListFormatter |
getInstance(Locale locale) |
Create a list formatter that is appropriate for a locale.
|
static ListFormatter |
getInstance(ULocale locale) |
Create a list formatter that is appropriate for a locale.
|
String |
getPatternForNumItems(int count) |
Returns the pattern to use for a particular item count.
|
public static ListFormatter getInstance(ULocale locale)
locale - the locale in question.public static ListFormatter getInstance(Locale locale)
locale - the locale in question.public static ListFormatter getInstance()
public String format(Object... items)
items - items to format. The toString() method is called on each.public String format(Collection<?> items)
items - items to format. The toString() method is called on each.public String getPatternForNumItems(int count)
count - the item count.IllegalArgumentException - when count is 0 or negative.