public class IlvPatternBasedListFormat extends IlvListFormat
The main patterns are called the "start format", the "mid format", and the "end format".
start(a,middle(b,middle(c,end(d,e))))
.
For the special cases of up to two elements, special format strings are used:
Note: This class may be obsoleted once the corresponding support is added to the International Components for Unicode library.
LONG, SHORT
Constructor and Description |
---|
IlvPatternBasedListFormat()
Deprecated.
Since JViews 8.7, please use the constructor
IlvPatternBasedListFormat(Locale) instead,
passing a locale explicitly - usually either
or
. |
IlvPatternBasedListFormat(Locale locale)
Creates a list formatter, based on a separator string suitable for the
given locale.
|
IlvPatternBasedListFormat(String endFormatString,
String middleFormatString,
String startFormatString,
String twoElementsFormatString,
String oneElementFormatString,
String zeroElementsString)
Creates a list formatter, based on the given format strings (patterns).
|
Modifier and Type | Method and Description |
---|---|
String |
format(String[] elements)
Returns the string that expresses the given elements, in order.
|
String |
getEndFormatString()
Returns the pattern that formats the part of the last two elements.
|
String |
getMiddleFormatString()
Returns the pattern that combines an element (other than the first element)
with the part that already combines the elements that follow it.
|
String |
getOneElementFormatString()
Returns the pattern that formats a list of a single element.
|
String |
getStartFormatString()
Returns the pattern that combines the first element with the part that
already combines the elements that follow it.
|
String |
getTwoElementsFormatString()
Returns the pattern that formats a list of two elements.
|
String |
getZeroElementsString()
Returns the string that represents a list of zero elements.
|
getInstance, getInstance, getInstance
@Deprecated public IlvPatternBasedListFormat()
IlvPatternBasedListFormat(Locale)
instead,
passing a locale explicitly - usually either
IlvLocaleUtil.getCurrentLocale()
or
IlvLocaleUtil.getServerLocale()
.Locale.getDefault()
public IlvPatternBasedListFormat(Locale locale)
public IlvPatternBasedListFormat(String endFormatString, String middleFormatString, String startFormatString, String twoElementsFormatString, String oneElementFormatString, String zeroElementsString)
endFormatString
- The pattern that formats the part of the last two
elements. This must be a format string that takes
two arguments.middleFormatString
- The pattern that combines an element (other than
the first element) with the part that already
combines the elements that follow it. This must
be a format string that takes two arguments.startFormatString
- The pattern that combines the first element with
the part that already combines the elements that
follow it. This must be a format string that
takes two arguments.twoElementsFormatString
- The pattern that formats a list of two
elements. This must be a format string that
takes two arguments.oneElementFormatString
- The pattern that formats a list of a single
element. This must be a format string that
takes one argument.zeroElementsString
- The string that represents a list of zero
elements. This must be a literal string, not a
format string.public String getZeroElementsString()
public String getOneElementFormatString()
public String getTwoElementsFormatString()
public String getEndFormatString()
public String getMiddleFormatString()
public String getStartFormatString()
public String format(String[] elements)
format
in class IlvListFormat
elements
- An array of strings.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.