public interface Numberer
Modifier and Type | Method and Description |
---|---|
java.lang.String |
dayName(int day,
int minWidth,
int maxWidth)
Get a day name or abbreviation
|
java.util.Locale |
defaultedLocale()
Whether this numberer has had its locale defaulted, i.e.
|
java.lang.String |
format(long number,
UnicodeString picture,
int groupSize,
java.lang.String groupSeparator,
java.lang.String letterValue,
java.lang.String ordinal)
Format a number into a string
|
java.lang.String |
format(long number,
UnicodeString picture,
NumericGroupFormatter numGrpFormatter,
java.lang.String letterValue,
java.lang.String ordinal)
Format a number into a string
|
java.lang.String |
getCalendarName(java.lang.String code)
Get the name of a calendar
|
java.lang.String |
getCountry()
Get the country used by this numberer
|
java.lang.String |
getEraName(int year)
Get the name for an era (e.g.
|
java.lang.String |
getOrdinalSuffixForDateTime(java.lang.String component)
Get an ordinal suffix for a particular component of a date/time.
|
java.lang.String |
halfDayName(int minutes,
int minWidth,
int maxWidth)
Get an am/pm indicator
|
java.lang.String |
monthName(int month,
int minWidth,
int maxWidth)
Get a month name or abbreviation
|
void |
setCountry(java.lang.String country)
Set the country used by this numberer (currently used only for names of timezones).
|
void setCountry(java.lang.String country)
Note: this method is called by the system when allocating a numberer for a specific language and country. Since numberers are normally shared across threads, it should not be changed after the initial creation of the Numberer.
country
- The ISO two-letter country code.java.lang.String getCountry()
java.util.Locale defaultedLocale()
java.lang.String format(long number, UnicodeString picture, int groupSize, java.lang.String groupSeparator, java.lang.String letterValue, java.lang.String ordinal)
number
- The number to be formattedpicture
- The format token. This is a single component of the format attribute
of xsl:number, e.g. "1", "01", "i", or "a"groupSize
- number of digits per group (0 implies no grouping)groupSeparator
- string to appear between groups of digitsletterValue
- The letter-value specified to xsl:number: "alphabetic" or
"traditional". Can also be an empty string or null.ordinal
- The value of the ordinal attribute specified to xsl:number
The value "yes" indicates that ordinal numbers should be used; "" or null indicates
that cardinal numbersjava.lang.String format(long number, UnicodeString picture, NumericGroupFormatter numGrpFormatter, java.lang.String letterValue, java.lang.String ordinal)
number
- The number to be formattedpicture
- The format token. This is a single component of the format attribute
of xsl:number, e.g. "1", "01", "i", or "a"numGrpFormatter
- an object that handles insertion of grouping separators into the formatted numberletterValue
- The letter-value specified to xsl:number: "alphabetic" or
"traditional". Can also be an empty string or null.ordinal
- The value of the ordinal attribute specified to xsl:number
The value "yes" indicates that ordinal numbers should be used; "" or null indicates
that cardinal numbersjava.lang.String monthName(int month, int minWidth, int maxWidth)
month
- The month number (1=January, 12=December)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of charactersjava.lang.String dayName(int day, int minWidth, int maxWidth)
day
- The month number (1=Monday, 7=Sunday)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of charactersjava.lang.String halfDayName(int minutes, int minWidth, int maxWidth)
minutes
- the minutes within the dayminWidth
- minimum width of outputmaxWidth
- maximum width of outputjava.lang.String getOrdinalSuffixForDateTime(java.lang.String component)
component
- the component specifier from a format-dateTime picture, for
example "M" for the month or "D" for the day.java.lang.String getEraName(int year)
year
- the proleptic gregorian year, using "0" for the year before 1ADjava.lang.String getCalendarName(java.lang.String code)
code
- The code representing the calendar as in the XSLT 2.0 spec, e.g. AD for the Gregorian calendarCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.