|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.icu.util.ListFormat
public final class ListFormat
Immutable class for formatting a list, using data from CLDR (or supplied separately). The class is not subclassable.
| Constructor Summary | |
|---|---|
ListFormat(String two,
String start,
String middle,
String end)
Create a ListFormatter from component strings, with definitions as in LDML. |
|
| Method Summary | |
|---|---|
String |
format(Collection<Object> items)
Format a collation of objects. |
String |
format(Object... items)
Format a list of objects. |
static ListFormat |
getInstance(Locale locale)
Create a list formatter that is appropriate for a locale. |
static ListFormat |
getInstance(ULocale locale)
Create a list formatter that is appropriate for a locale. |
String |
transform(Collection<String> source)
Transform the input in some way, to be determined by the subclass. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListFormat(String two,
String start,
String middle,
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.| Method Detail |
|---|
public static ListFormat getInstance(ULocale locale)
locale - the locale in question.
public static ListFormat getInstance(Locale locale)
locale - the locale in question.
public String format(Object... items)
items - items to format. The toString() method is called on each.
public String format(Collection<Object> items)
items - items to format. The toString() method is called on each.
public String transform(Collection<String> source)
Transform
transform in interface Transform<Collection<String>,String>source - to be transformed (eg lowercased)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||