com.ibm.icu.text
Class NumberingSystem

java.lang.Object
  extended by com.ibm.icu.text.NumberingSystem

public class NumberingSystem
extends Object

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
Status:
Stable ICU 4.2.

Constructor Summary
NumberingSystem()
          Default constructor.
 
Method Summary
static String[] getAvailableNames()
          Returns a string array containing a list of the names of numbering systems currently known to ICU.
 String getDescription()
          Returns the description string of the current numbering system.
static NumberingSystem getInstance()
          Returns the default numbering system for the default locale.
static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in)
          Factory method for creating a numbering system.
static NumberingSystem getInstance(Locale inLocale)
          Returns the default numbering system for the specified locale.
static NumberingSystem getInstance(ULocale locale)
          Returns the default numbering system for the specified ULocale.
static NumberingSystem getInstanceByName(String name)
          Returns a numbering system from one of the predefined numbering systems known to ICU.
 String getName()
          Returns the string representing the name of the numbering system.
 int getRadix()
          Returns the radix of the current numbering system.
 boolean isAlgorithmic()
          Returns the numbering system's algorithmic status.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberingSystem

public NumberingSystem()
Default constructor. Returns a numbering system that uses the Western decimal digits 0 through 9.

Status:
Stable ICU 4.2.
Method Detail

getInstance

public static NumberingSystem getInstance(int radix_in,
                                          boolean isAlgorithmic_in,
                                          String desc_in)
Factory method for creating a numbering system.

Parameters:
radix_in - The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10.
isAlgorithmic_in - Specifies whether the numbering system is algorithmic (true) or numeric (false).
desc_in - 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.
Status:
Stable ICU 4.2.

getInstance

public static NumberingSystem getInstance(Locale inLocale)
Returns the default numbering system for the specified locale.

Status:
Stable ICU 4.2.

getInstance

public static NumberingSystem getInstance(ULocale locale)
Returns the default numbering system for the specified ULocale.

Status:
Stable ICU 4.2.

getInstance

public static NumberingSystem getInstance()
Returns the default numbering system for the default locale.

Status:
Stable ICU 4.2.

getInstanceByName

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 - 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.
Status:
Stable ICU 4.2.

getAvailableNames

public static String[] getAvailableNames()
Returns a string array containing a list of the names of numbering systems currently known to ICU.

Status:
Stable ICU 4.2.

isValidDigitString

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 meet the following criteria: 1. Digits must be in Unicode's basic multilingual plane.

Status:
Stable ICU 4.2.

getRadix

public int getRadix()
Returns the radix of the current numbering system.

Status:
Stable ICU 4.2.

getDescription

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.

Status:
Stable ICU 4.2.

getName

public String getName()
Returns the string representing the name of the numbering system.

Status:
Draft ICU 4.6.

isAlgorithmic

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.

Status:
Stable ICU 4.2.


Copyright (c) 2010 IBM Corporation and others.