Top Description Inners Fields Constructors Methods
com.ibm.icu.text

public Class NumberingSystem

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Locale, .MissingResourceException, com.ibm.icu.impl.CacheBase, .ICUData, .ICUResourceBundle, .SoftCache, com.ibm.icu.util.ULocale, .ULocale.Category, .UResourceBundle, .UResourceBundleIterator

NumberingSystem is the base class for all number systems. This class provides the interface for setting different numbering system types, whether it be a simple alternate digit system such as Thai digits or Devanagari digits, or an algorithmic numbering system such as Hebrew numbering or Chinese numbering.
Author
John Emmons
ICU Status
Stable since ICU 4.2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private static CacheBase<String, NumberingSystem, NumberingSystem.LocaleLookupData>
cachedLocaleData

Cache to hold the NumberingSystems by Locale.

private static CacheBase<String, NumberingSystem, Void>
cachedStringData

Cache to hold the NumberingSystems by name.

private String
public static final NumberingSystem
LATIN

For convenience, an instance representing the latn numbering system, which corresponds to digits in the ASCII range '0' through '9'.

private String
private static final String[]
private int

Constructor Summary

AccessConstructor and Description
public
NumberingSystem()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public static String[]

Returns:

An array of strings in alphabetical (invariant) order.
getAvailableNames
()

Returns a string array containing a list of the names of numbering systems currently known to ICU.

public String
getDescription()

Returns the description string of the current numbering system.

public static NumberingSystem
getInstance(int
The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10.
radix_in
,
boolean
Specifies whether the numbering system is algorithmic (true) or numeric (false).
isAlgorithmic_in
,
String
String used to describe the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.
desc_in
)

Factory method for creating a numbering system.

private static NumberingSystem
getInstance(String
The string representing the name of the numbering system.
name_in
,
int
The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10.
radix_in
,
boolean
Specifies whether the numbering system is algorithmic (true) or numeric (false).
isAlgorithmic_in
,
String
String used to describe the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.
desc_in
)

Factory method for creating a numbering system.

public static NumberingSystem
getInstance(Locale inLocale)

Returns the default numbering system for the specified locale.

public static NumberingSystem
getInstance(ULocale locale)

Returns the default numbering system for the specified ULocale.

public static NumberingSystem
getInstance()

Returns the default numbering system for the default FORMAT locale.

public static NumberingSystem

Returns:

The NumberingSystem instance, or null if not available.
getInstanceByName
(String
The name of the desired numbering system. Numbering system names often correspond with the name of the script they are associated with. For example, "thai" for Thai digits, "hebr" for Hebrew numerals.
name
)

Returns a numbering system from one of the predefined numbering systems known to ICU.

public String
getName()

Returns the string representing the name of the numbering system.

public int
getRadix()

Returns the radix of the current numbering system.

public boolean
isAlgorithmic()

Returns the numbering system's algorithmic status.

public static boolean
isValidDigitString(String str)

Convenience method to determine if a given digit string is valid for use as a descriptor of a numeric ( non-algorithmic ) numbering system.

pack-priv static NumberingSystem
private static NumberingSystem
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmicback to summary
private boolean algorithmic
cachedLocaleDataback to summary
private static CacheBase<String, NumberingSystem, NumberingSystem.LocaleLookupData> cachedLocaleData

Cache to hold the NumberingSystems by Locale.

cachedStringDataback to summary
private static CacheBase<String, NumberingSystem, Void> cachedStringData

Cache to hold the NumberingSystems by name.

descback to summary
private String desc
LATINback to summary
public static final NumberingSystem LATIN

For convenience, an instance representing the latn numbering system, which corresponds to digits in the ASCII range '0' through '9'.

ICU Status
Stable since ICU 60.
nameback to summary
private String name
OTHER_NS_KEYWORDSback to summary
private static final String[] OTHER_NS_KEYWORDS
radixback to summary
private int radix

Constructor Detail

NumberingSystemback to summary
public NumberingSystem()

Default constructor. Returns a numbering system that uses the Latin-script decimal digits 0 through 9. This should be equivalent to NumberingSystem.LATIN.

ICU Status
Stable since ICU 4.2.

Method Detail

getAvailableNamesback to summary
public static String[] getAvailableNames()

Returns a string array containing a list of the names of numbering systems currently known to ICU.

Returns:String[]

An array of strings in alphabetical (invariant) order.

ICU Status
Stable since ICU 4.2.
getDescriptionback to summary
public String getDescription()

Returns the description string of the current numbering system. The description string describes the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in)

Factory method for creating a numbering system.

Parameters
radix_in:int

The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10.

isAlgorithmic_in:boolean

Specifies whether the numbering system is algorithmic (true) or numeric (false).

desc_in:String

String used to describe the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
private static NumberingSystem getInstance(String name_in, int radix_in, boolean isAlgorithmic_in, String desc_in)

Factory method for creating a numbering system.

Parameters
name_in:String

The string representing the name of the numbering system.

radix_in:int

The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10.

isAlgorithmic_in:boolean

Specifies whether the numbering system is algorithmic (true) or numeric (false).

desc_in:String

String used to describe the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.

ICU Status
Stable since ICU 4.6.
getInstanceback to summary
public static NumberingSystem getInstance(Locale inLocale)

Returns the default numbering system for the specified locale.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static NumberingSystem getInstance(ULocale locale)

Returns the default numbering system for the specified ULocale.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static NumberingSystem getInstance()

Returns the default numbering system for the default FORMAT locale.

ICU Status
Stable since ICU 4.2.
See Also
Category#FORMAT
getInstanceByNameback to summary
public static NumberingSystem getInstanceByName(String name)

Returns a numbering system from one of the predefined numbering systems known to ICU. Numbering system names are based on the numbering systems defined in CLDR. To get a list of available numbering systems, use the getAvailableNames method.

Parameters
name:String

The name of the desired numbering system. Numbering system names often correspond with the name of the script they are associated with. For example, "thai" for Thai digits, "hebr" for Hebrew numerals.

Returns:NumberingSystem

The NumberingSystem instance, or null if not available.

ICU Status
Stable since ICU 4.2.
getNameback to summary
public String getName()

Returns the string representing the name of the numbering system.

ICU Status
Stable since ICU 4.6.
getRadixback to summary
public int getRadix()

Returns the radix of the current numbering system.

ICU Status
Stable since ICU 4.2.
isAlgorithmicback to summary
public boolean isAlgorithmic()

Returns the numbering system's algorithmic status. If true, the numbering system is algorithmic and uses an RBNF formatter to format numerals. If false, the numbering system is numeric and uses a fixed set of digits.

ICU Status
Stable since ICU 4.2.
isValidDigitStringback to summary
public static boolean isValidDigitString(String str)

Convenience method to determine if a given digit string is valid for use as a descriptor of a numeric ( non-algorithmic ) numbering system. In order for a digit string to be valid, it must contain exactly ten Unicode code points.

ICU Status
Stable since ICU 4.2.
lookupInstanceByLocaleback to summary
pack-priv static NumberingSystem lookupInstanceByLocale(NumberingSystem.LocaleLookupData localeLookupData)
lookupInstanceByNameback to summary
private static NumberingSystem lookupInstanceByName(String name)
com.ibm.icu.text back to summary

private Class NumberingSystem.LocaleLookupData

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final ULocale
public final String

Constructor Summary

AccessConstructor and Description
pack-priv
LocaleLookupData(ULocale locale, String numbersKeyword)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

localeback to summary
public final ULocale locale
numbersKeywordback to summary
public final String numbersKeyword

Constructor Detail

LocaleLookupDataback to summary
pack-priv LocaleLookupData(ULocale locale, String numbersKeyword)