Package com.icl.saxon.number
Class Numberer_en
- java.lang.Object
-
- com.icl.saxon.number.Numberer_en
-
- All Implemented Interfaces:
Numberer
- Direct Known Subclasses:
Numberer_de
public class Numberer_en extends Object implements Numberer
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cyrillicLower
protected String
cyrillicUpper
protected String[]
englishTens
protected String[]
englishUnits
protected String
greekLower
protected String
greekUpper
protected String
hebrew
protected String
hiraganaA
protected String
hiraganaI
protected String
kanjiDigits
protected String
katakanaA
protected String
katakanaI
protected String
latinLower
protected String
latinUpper
protected String
westernDigits
-
Constructor Summary
Constructors Constructor Description Numberer_en()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
alphaDefault(int number, char formchar, StringBuffer sb)
Default processing with an alphabetic format token: use the contiguous range of Unicode letters starting with that token.String
format(int number, String picture, int groupSize, String groupSeparator, String letterValue)
Format a number into a stringprotected String
toAlpha(int number, int min, int max)
Format the number as an alphabetic label using the alphabet consisting of consecutive Unicode characters from min to maxprotected String
toAlphaSequence(int number, String alphabet)
Convert the number into an alphabetic label using a given alphabet.protected String
toRadical(int number, String digits, String picture, int groupSize, String groupSeparator)
Convert the number into a decimal or other representation using the given set of digits.protected String
toRoman(int n)
Generate a Roman numeral (in lower case)String
toWords(int number)
Show the number as English words
-
-
-
Field Detail
-
westernDigits
protected String westernDigits
-
latinUpper
protected String latinUpper
-
latinLower
protected String latinLower
-
greekUpper
protected String greekUpper
-
greekLower
protected String greekLower
-
cyrillicUpper
protected String cyrillicUpper
-
cyrillicLower
protected String cyrillicLower
-
hebrew
protected String hebrew
-
hiraganaA
protected String hiraganaA
-
katakanaA
protected String katakanaA
-
hiraganaI
protected String hiraganaI
-
katakanaI
protected String katakanaI
-
kanjiDigits
protected String kanjiDigits
-
englishUnits
protected String[] englishUnits
-
englishTens
protected String[] englishTens
-
-
Method Detail
-
format
public String format(int number, String picture, int groupSize, String groupSeparator, String letterValue)
Format a number into a string- Specified by:
format
in interfaceNumberer
- Parameters:
number
- The number to be formattedpicture
- The format specification. 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
- as defined in xsl:number ("alphabetic" or "traditional" or "")- Returns:
- the formatted number
-
alphaDefault
protected void alphaDefault(int number, char formchar, StringBuffer sb)
Default processing with an alphabetic format token: use the contiguous range of Unicode letters starting with that token.
-
toAlpha
protected String toAlpha(int number, int min, int max)
Format the number as an alphabetic label using the alphabet consisting of consecutive Unicode characters from min to max
-
toAlphaSequence
protected String toAlphaSequence(int number, String alphabet)
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, ....
-
toRadical
protected String toRadical(int number, String digits, String picture, int groupSize, String groupSeparator)
Convert the number into a decimal or other representation using the given set of digits. For example, if the digits are "01" the sequence is 1, 10, 11, 100, 101, 110, 111, ...- Parameters:
number
- the number to be formatteddigits
- the set of digits to be usedpicture
- the formatting token, e.g. 001 means include leading zeroes to give at least three decimal placesgroupsize
- the number of digits in each groupgroupSeparator
- the separator to use between groups of digits.
-
toRoman
protected String toRoman(int n)
Generate a Roman numeral (in lower case)
-
toWords
public String toWords(int number)
Show the number as English words
-
-