Added in API level 24

NumberingSystem


open class NumberingSystem
kotlin.Any
   ↳ android.icu.text.NumberingSystem

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.

Summary

Public constructors

Default constructor.

Public methods
open static Array<String!>!

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

open String!

Returns the description string of the current numbering system.

open static NumberingSystem!
getInstance(radix_in: Int, isAlgorithmic_in: Boolean, desc_in: String!)

Factory method for creating a numbering system.

open static NumberingSystem!
getInstance(inLocale: Locale!)

Returns the default numbering system for the specified locale.

open static NumberingSystem!
getInstance(locale: ULocale!)

Returns the default numbering system for the specified ULocale.

open static NumberingSystem!

Returns the default numbering system for the default FORMAT locale.

open static NumberingSystem!

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

open String!

Returns the string representing the name of the numbering system.

open Int

Returns the radix of the current numbering system.

open Boolean

Returns the numbering system's algorithmic status.

open static Boolean

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

Properties
static NumberingSystem!

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

Public constructors

NumberingSystem

Added in API level 24
NumberingSystem()

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

Public methods

getAvailableNames

Added in API level 24
open static fun getAvailableNames(): Array<String!>!

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

Return
Array<String!>! An array of strings in alphabetical (invariant) order.

getDescription

Added in API level 24
open fun getDescription(): String!

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.

getInstance

Added in API level 24
open static fun getInstance(
    radix_in: Int,
    isAlgorithmic_in: Boolean,
    desc_in: String!
): NumberingSystem!

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.

getInstance

Added in API level 24
open static fun getInstance(inLocale: Locale!): NumberingSystem!

Returns the default numbering system for the specified locale.

getInstance

Added in API level 24
open static fun getInstance(locale: ULocale!): NumberingSystem!

Returns the default numbering system for the specified ULocale.

getInstance

Added in API level 24
open static fun getInstance(): NumberingSystem!

Returns the default numbering system for the default FORMAT locale.

getInstanceByName

Added in API level 24
open static fun getInstanceByName(name: String!): NumberingSystem!

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.
Return
NumberingSystem! The NumberingSystem instance, or null if not available.

getName

Added in API level 24
open fun getName(): String!

Returns the string representing the name of the numbering system.

getRadix

Added in API level 24
open fun getRadix(): Int

Returns the radix of the current numbering system.

isAlgorithmic

Added in API level 24
open fun isAlgorithmic(): Boolean

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.

isValidDigitString

Added in API level 24
open static fun isValidDigitString(str: String!): Boolean

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.

Properties

LATIN

Added in API level 29
static val LATIN: NumberingSystem!

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