| java.lang.Object net.sf.saxon.number.Numberer_en
All known Subclasses: net.sf.saxon.number.Numberer_de,
Numberer_en | public class Numberer_en implements Numberer,Serializable(Code) | | Class Numberer_en does number formatting for language="en".
This supports the xsl:number element.
Methods and data are declared as protected, and static is avoided, to allow easy subclassing.
author: Michael H. Kay |
Method Summary | |
protected void | alphaDefault(long number, char formchar, FastStringBuffer sb) Default processing with an alphabetic format token: use the contiguous
range of Unicode letters starting with that token. | public String | dayName(int day, int minWidth, int maxWidth) | public String | format(long number, String picture, int groupSize, String groupSeparator, String letterValue, String ordinal) Format a number into a string
Parameters: number - The number to be formatted Parameters: picture - The format token. | public String | getEraName(int year) Get the name for an era (e.g. | public String | getOrdinalSuffixForDateTime(String component) Get an ordinal suffix for a particular component of a date/time.
Parameters: component - the component specifier from a format-dateTime picture, forexample "M" for the month or "D" for the day. | public String | getTimezoneName(int tz) | public String | halfDayName(int minutes, int minWidth, int maxWidth) | public String | monthName(int month, int minWidth, int maxWidth) | protected String | ordinalSuffix(String ordinalParam, long number) | public void | setCountry(String country) | protected String | toAlpha(long number, int min, int max) | protected String | toAlphaSequence(long number, String alphabet) Convert the number into an alphabetic label using a given alphabet. | public String | toOrdinalWords(String ordinalParam, long number, int wordCase) | public static String | toRoman(long n) | public String | toWords(long number) Show the number as words in title case. | public String | toWords(long number, int wordCase) | static void | tz(double offset, String name, String country) |
LOWER_CASE | final public static int LOWER_CASE(Code) | | |
TITLE_CASE | final public static int TITLE_CASE(Code) | | |
UPPER_CASE | final public static int UPPER_CASE(Code) | | |
cyrillicLower | final protected static String cyrillicLower(Code) | | |
cyrillicUpper | final protected static String cyrillicUpper(Code) | | |
westernDigits | final protected static String westernDigits(Code) | | |
alphaDefault | protected void alphaDefault(long number, char formchar, FastStringBuffer sb)(Code) | | Default processing with an alphabetic format token: use the contiguous
range of Unicode letters starting with that token.
|
dayName | public String dayName(int day, int minWidth, int maxWidth)(Code) | | Get a day name or abbreviation
Parameters: day - The day of the week (1=Monday, 7=Sunday) Parameters: minWidth - The minimum number of characters Parameters: maxWidth - The maximum number of characters |
format | public String format(long number, String picture, int groupSize, String groupSeparator, String letterValue, String ordinal)(Code) | | Format a number into a string
Parameters: number - The number to be formatted Parameters: picture - The format token. This is a single component of the format attributeof xsl:number, e.g. "1", "01", "i", or "a" Parameters: groupSize - number of digits per group (0 implies no grouping) Parameters: groupSeparator - string to appear between groups of digits Parameters: letterValue - The letter-value specified to xsl:number: "alphabetic" or"traditional". Can also be an empty string or null. Parameters: ordinal - The value of the ordinal attribute specified to xsl:numberThe value "yes" indicates that ordinal numbers should be used; "" or null indicatesthat cardinal numbers the formatted number. Note that no errors are reported; if the requestis invalid, the number is formatted as if the string() function were used. |
getEraName | public String getEraName(int year)(Code) | | 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)(Code) | | Get an ordinal suffix for a particular component of a date/time.
Parameters: component - the component specifier from a format-dateTime picture, forexample "M" for the month or "D" for the day. a string that is acceptable in the ordinal attribute of xsl:numberto achieve the required ordinal representation. For example, "-e" for the day componentin German, to have the day represented as "dritte August". |
getTimezoneName | public String getTimezoneName(int tz)(Code) | | Get the name of a timezone
tz: the offset of the timezone from GMT in minutes |
halfDayName | public String halfDayName(int minutes, int minWidth, int maxWidth)(Code) | | Get an am/pm indicator
Parameters: minutes - the minutes within the day Parameters: minWidth - minimum width of output Parameters: maxWidth - maximum width of output the AM or PM indicator |
monthName | public String monthName(int month, int minWidth, int maxWidth)(Code) | | Get a month name or abbreviation
Parameters: month - The month number (1=January, 12=December) Parameters: minWidth - The minimum number of characters Parameters: maxWidth - The maximum number of characters |
ordinalSuffix | protected String ordinalSuffix(String ordinalParam, long number)(Code) | | Construct the ordinal suffix for a number, for example "st", "nd", "rd"
Parameters: ordinalParam - the value of the ordinal attribute (used in non-Englishlanguage implementations) Parameters: number - the number being formatted the ordinal suffix to be appended to the formatted number |
setCountry | public void setCountry(String country)(Code) | | Set the country used by this numberer (currenly used only for names of timezones)
|
toAlpha | protected String toAlpha(long number, int min, int max)(Code) | | Format the number as an alphabetic label using the alphabet consisting
of consecutive Unicode characters from min to max
|
toAlphaSequence | protected String toAlphaSequence(long number, String alphabet)(Code) | | Convert the number into an alphabetic label using a given alphabet.
For example, if the alphabet is "xyz" the sequence is x, y, z, xx, xy, xz, ....
|
toOrdinalWords | public String toOrdinalWords(String ordinalParam, long number, int wordCase)(Code) | | Show an ordinal number as English words in a requested case (for example, Twentyfirst)
|
toRoman | public static String toRoman(long n)(Code) | | Generate a Roman numeral (in lower case)
|
toWords | public String toWords(long number)(Code) | | Show the number as words in title case. (We choose title case because
the result can then be converted algorithmically to lower case or upper case).
|
toWords | public String toWords(long number, int wordCase)(Code) | | |
|
|