net.sf.saxon.number
Interface Numberer
- AbstractNumberer, Numberer_da, Numberer_de, Numberer_en, Numberer_fr, Numberer_frBE, Numberer_it, Numberer_nl, Numberer_nlBE, Numberer_sv
public interface Numberer
Interface Numberer supports number formatting. There is a separate
implementation for each language, e.g. Numberer_en for English.
This supports the xsl:number element
String | dayName(int day, int minWidth, int maxWidth) - Get a day name or abbreviation
|
String | format(long number, String picture, int groupSize, String groupSeparator, String letterValue, String ordinal) - Format a number into a string
|
String | getCalendarName(String code) - Get the name of a calendar
|
String | getCountry() - Get the country used by this numberer
|
String | getEraName(int year) - Get the name for an era (e.g.
|
String | getOrdinalSuffixForDateTime(String component) - Get an ordinal suffix for a particular component of a date/time.
|
String | halfDayName(int minutes, int minWidth, int maxWidth) - Get an am/pm indicator
|
String | monthName(int month, int minWidth, int maxWidth) - Get a month name or abbreviation
|
void | setCountry(String country) - Set the country used by this numberer (currently used only for names of timezones)
|
dayName
public String dayName(int day,
int minWidth,
int maxWidth)
Get a day name or abbreviation
day
- The month number (1=Monday, 7=Sunday)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of characters
format
public String format(long number,
String picture,
int groupSize,
String groupSeparator,
String letterValue,
String ordinal)
Format a number into a string
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 numbers
- the formatted number. Note that no errors are reported; if the request
is invalid, the number is formatted as if the string() function were used.
getCalendarName
public String getCalendarName(String code)
Get the name of a calendar
code
- The code representing the calendar as in the XSLT 2.0 spec, e.g. AD for the Gregorian calendar
getCountry
public String getCountry()
Get the country used by this numberer
getEraName
public String getEraName(int year)
Get the name for an era (e.g. "BC" or "AD")
year
- the proleptic gregorian year, using "0" for the year before 1AD
getOrdinalSuffixForDateTime
public String getOrdinalSuffixForDateTime(String component)
Get an ordinal suffix for a particular component of a date/time.
component
- the component specifier from a format-dateTime picture, for
example "M" for the month or "D" for the day.
- a string that is acceptable in the ordinal attribute of xsl:number
to achieve the required ordinal representation. For example, "-e" for the day component
in German, to have the day represented as "dritte August".
halfDayName
public String halfDayName(int minutes,
int minWidth,
int maxWidth)
Get an am/pm indicator
minutes
- the minutes within the dayminWidth
- minimum width of outputmaxWidth
- maximum width of output
monthName
public String monthName(int month,
int minWidth,
int maxWidth)
Get a month name or abbreviation
month
- The month number (1=January, 12=December)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of characters
setCountry
public void setCountry(String country)
Set the country used by this numberer (currently used only for names of timezones)