public final class ListFormatter
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ListFormatter.Style |
Deprecated.
This API is ICU internal only.
|
| Constructor | Description |
|---|---|
ListFormatter(java.lang.String two,
java.lang.String start,
java.lang.String middle,
java.lang.String end) |
Deprecated.
This API is ICU internal only.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
format(java.lang.Object... items) |
Format a list of objects.
|
java.lang.String |
format(java.util.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(ULocale locale) |
Create a list formatter that is appropriate for a locale.
|
static ListFormatter |
getInstance(ULocale locale,
ListFormatter.Style style) |
Deprecated.
This API is ICU internal only.
|
static ListFormatter |
getInstance(java.util.Locale locale) |
Create a list formatter that is appropriate for a locale.
|
ULocale |
getLocale() |
Deprecated.
This API is ICU internal only.
|
java.lang.String |
getPatternForNumItems(int count) |
Returns the pattern to use for a particular item count.
|
@Deprecated
public ListFormatter(java.lang.String two,
java.lang.String start,
java.lang.String middle,
java.lang.String end)
two - string for two items, containing {0} for the first, and {1}
for the second.start - string for the start of a list items, containing {0} for the
first, and {1} for the rest.middle - string for the start of a list items, containing {0} for the
first part of the list, and {1} for the rest of the list.end - string for the end of a list items, containing {0} for the
first part of the list, and {1} for the last item.public static ListFormatter getInstance(ULocale locale)
locale - the locale in question.public static ListFormatter getInstance(java.util.Locale locale)
locale - the locale in question.@Deprecated public static ListFormatter getInstance(ULocale locale, ListFormatter.Style style)
locale - the locale in question.style - the stylepublic static ListFormatter getInstance()
public java.lang.String format(java.lang.Object... items)
items - items to format. The toString() method is called on each.public java.lang.String format(java.util.Collection<?> items)
items - items to format. The toString() method is called on each.public java.lang.String getPatternForNumItems(int count)
count - the item count.java.lang.IllegalArgumentException - when count is 0 or negative.@Deprecated public ULocale getLocale()
Copyright ? 2016 Unicode, Inc. and others.