public class PeriodFormatterData extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
trace |
| Constructor and Description |
|---|
PeriodFormatterData(String localeName,
DataRecord dr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowZero()
Return true if zeros are allowed in the display.
|
int |
appendCount(TimeUnit unit,
boolean omitCount,
boolean useDigitPrefix,
int count,
int cv,
boolean useSep,
String name,
boolean last,
StringBuffer sb)
Append a count to the string builder.
|
void |
appendCountValue(int count,
int integralDigits,
int decimalDigits,
StringBuffer sb)
Append a count value to the builder.
|
void |
appendDigits(long num,
int mindigits,
int maxdigits,
StringBuffer sb)
Append digits to the string builder, using this.zero for '0' etc.
|
void |
appendInteger(int num,
int mindigits,
int maxdigits,
StringBuffer sb) |
boolean |
appendPrefix(int tl,
int td,
StringBuffer sb)
Append the appropriate prefix to the string builder, depending on whether and
how a limit and direction are to be displayed.
|
void |
appendSkippedUnit(StringBuffer sb)
Append a marker for skipped units internal to a string.
|
void |
appendSuffix(int tl,
int td,
StringBuffer sb)
Append the appropriate suffix to the string builder, depending on whether and
how a limit and direction are to be displayed.
|
boolean |
appendUnit(TimeUnit unit,
int count,
int cv,
int uv,
boolean useCountSep,
boolean useDigitPrefix,
boolean multiple,
boolean last,
boolean wasSkipped,
StringBuffer sb)
Append the count and unit to the string builder.
|
boolean |
appendUnitSeparator(TimeUnit unit,
boolean longSep,
boolean afterFirst,
boolean beforeLast,
StringBuffer sb)
Append the appropriate separator between units
|
int |
pluralization()
Return the pluralization format used by this locale.
|
int |
useMilliseconds() |
boolean |
weeksAloneOnly() |
public PeriodFormatterData(String localeName, DataRecord dr)
public int pluralization()
public boolean allowZero()
public boolean weeksAloneOnly()
public int useMilliseconds()
public boolean appendPrefix(int tl,
int td,
StringBuffer sb)
tl - how and whether to display the time limittd - how and whether to display the time directionsb - the string builder to which to append the textpublic void appendSuffix(int tl,
int td,
StringBuffer sb)
tl - how and whether to display the time limittd - how and whether to display the time directionsb - the string builder to which to append the textpublic boolean appendUnit(TimeUnit unit, int count, int cv, int uv, boolean useCountSep, boolean useDigitPrefix, boolean multiple, boolean last, boolean wasSkipped, StringBuffer sb)
unit - the unit to appendcount - the count of units, * 1000cv - the format to use for displaying the countuv - the format to use for displaying the unituseCountSep - if false, force no separator between count and unituseDigitPrefix - if true, use the digit prefixmultiple - true if there are multiple units in this stringlast - true if this is the last unitwasSkipped - true if the unit(s) before this were skippedsb - the string builder to which to append the textpublic int appendCount(TimeUnit unit, boolean omitCount, boolean useDigitPrefix, int count, int cv, boolean useSep, String name, boolean last, StringBuffer sb)
unit - the unitcount - the countcv - the format to use for displaying the countuseSep - whether to use the count separator, if availablename - the term namelast - true if this is the last unit to be formattedsb - the string builder to which to append the textpublic void appendCountValue(int count,
int integralDigits,
int decimalDigits,
StringBuffer sb)
count - the countintegralDigits - the number of integer digits to displaydecimalDigits - the number of decimal digits to display, <= 3sb - the string builder to which to append the textpublic void appendInteger(int num,
int mindigits,
int maxdigits,
StringBuffer sb)
public void appendDigits(long num,
int mindigits,
int maxdigits,
StringBuffer sb)
num - the integer to appendmindigits - the minimum number of digits to appendmaxdigits - the maximum number of digits to appendsb - the string builder to which to append the textpublic void appendSkippedUnit(StringBuffer sb)
sb - the string builder to which to append the textpublic boolean appendUnitSeparator(TimeUnit unit, boolean longSep, boolean afterFirst, boolean beforeLast, StringBuffer sb)
unit - the unit to which to append the separatorafterFirst - true if this is the first unit formattedbeforeLast - true if this is the next-to-last unit to be formattedsb - the string builder to which to append the text