public class ICUNumbererPE extends AbstractNumberer
Note that in the case that the ICU libraries have not been loaded, then this class is not instantiated. However, the public static functions, e.g. getLocales() could in theory be accessed via an XSLT stylesheet (such as the documentation generators for example) and these invoke ICU features The guard function com.saxonica.config.ICUNumbererPE.hasICU() can be used to check.
cyrillicLower, cyrillicUpper, greekLower, greekUpper, hebrew, hiraganaA, hiraganaI, katakanaA, katakanaI, latinLower, latinUpper, LOWER_CASE, TITLE_CASE, UPPER_CASE, westernDigits
Constructor and Description |
---|
ICUNumbererPE() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
availableOrdinalNumberings(java.lang.String loc)
Return the available ordinal numbering schemes available for a given locale
|
static java.lang.String[] |
availableSpelloutNumberings(java.lang.String loc)
Return the available spellout numbering schemes available for a given locale
|
protected void |
config(java.util.Locale locale,
java.lang.String privateUseExtension,
Configuration config)
Configure an ICU numberer.
|
java.lang.String |
dayName(int day,
int minWidth,
int maxWidth)
Return an appropriate day name, using ICU data
The approach is to try each of the forms available in descending order of 'size'
until we have the first that fits the width constraints.
|
java.util.Locale |
defaultedLocale()
Returns the locale that was used by default, rather than that requested.
|
static java.lang.String |
getICUVersion()
Return the version of the ICU supported in this implementation
|
static java.lang.String[] |
getLocales()
Return all the locales available for collation
|
static ICUNumbererPE |
getNumberer(java.util.Locale locale,
java.lang.String privateUseExtension,
Configuration config)
Returns a suitable configured ICU numberer or a specialist subclass thereof.
|
static java.lang.String[] |
getPreferences() |
java.lang.String |
monthName(int month,
int minWidth,
int maxWidth)
Return an appropriate month name, using ICU data
The approach is to try each of the forms available in descending order of 'size'
until we have the first that fits the width constraints.
|
java.lang.String |
ordinalSuffix(java.lang.String ordinalParam,
long number)
Construct the ordinal suffix for a number, for example "st", "nd", "rd".
|
java.lang.String |
postProcess(java.lang.String result)
Post-process a spelled-out number.
|
java.lang.String |
postProcessOrdinal(java.lang.String result,
java.lang.String ordinalParam)
Post-process an ordinal spelled-out number.
|
static java.lang.String |
realLocale(java.lang.String loc)
Return the real language to be used for a given locale
|
java.lang.String |
toOrdinalWords(java.lang.String ordinalParam,
long number,
int wordCase)
Show an ordinal number as English words in a requested case (for example, Twentyfirst)
|
java.lang.String |
toWords(long number)
Show the number as words in title case.
|
java.lang.String |
toWords(long number,
int wordCase)
Format a number as English words with specified case options
|
alphaDefault, convertDigitSystem, format, format, getCalendarName, getCountry, getEraName, getLanguage, getOrdinalSuffixForDateTime, halfDayName, setCountry, setLanguage, toAlpha, toAlphaSequence, toJapanese, toRoman
public static ICUNumbererPE getNumberer(java.util.Locale locale, java.lang.String privateUseExtension, Configuration config)
locale
- the locale to useprivateUseExtension
- the language code extension used to denote required numberingconfig
- the system Configurationprotected void config(java.util.Locale locale, java.lang.String privateUseExtension, Configuration config)
locale
- the locale to useprivateUseExtension
- the language code extension used to denote required numberingconfig
- the system Configurationpublic java.util.Locale defaultedLocale()
defaultedLocale
in interface Numberer
defaultedLocale
in class AbstractNumberer
public static java.lang.String[] getLocales()
public static java.lang.String[] getPreferences()
public static java.lang.String[] availableSpelloutNumberings(java.lang.String loc)
loc
- the locale codepublic static java.lang.String[] availableOrdinalNumberings(java.lang.String loc)
loc
- the locale codepublic static java.lang.String realLocale(java.lang.String loc)
loc
- the locale codepublic static java.lang.String getICUVersion()
public java.lang.String ordinalSuffix(java.lang.String ordinalParam, long number)
AbstractNumberer
ordinalSuffix
in class AbstractNumberer
ordinalParam
- the value of the ordinal attribute (used in non-English
language implementations)number
- the number being formattedpublic java.lang.String toWords(long number)
AbstractNumberer
toWords
in class AbstractNumberer
number
- the number to be formattedpublic java.lang.String toWords(long number, int wordCase)
AbstractNumberer
toWords
in class AbstractNumberer
number
- the number to be formattedwordCase
- the required case for example AbstractNumberer.UPPER_CASE
,
AbstractNumberer.LOWER_CASE
, AbstractNumberer.TITLE_CASE
public java.lang.String toOrdinalWords(java.lang.String ordinalParam, long number, int wordCase)
AbstractNumberer
toOrdinalWords
in class AbstractNumberer
ordinalParam
- the value of the "ordinal" attribute as supplied by the usernumber
- the number to be formattedwordCase
- the required case for example AbstractNumberer.UPPER_CASE
,
AbstractNumberer.LOWER_CASE
, AbstractNumberer.TITLE_CASE
public java.lang.String postProcess(java.lang.String result)
result
- The spelled-out number generated by ICUpublic java.lang.String postProcessOrdinal(java.lang.String result, java.lang.String ordinalParam)
result
- The spelled-out ordinal generated by ICUordinalParam
- The ordinal parameter, if anypublic java.lang.String monthName(int month, int minWidth, int maxWidth)
monthName
in interface Numberer
monthName
in class AbstractNumberer
month
- The month number (1=January, 12=December)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of characterspublic java.lang.String dayName(int day, int minWidth, int maxWidth)
dayName
in interface Numberer
dayName
in class AbstractNumberer
day
- The day of the week (1=Monday, 7=Sunday)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of charactersCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.