Package limn.i18n

Enum Class NumberingSystem

java.lang.Object
java.lang.Enum<NumberingSystem>
limn.i18n.NumberingSystem
All Implemented Interfaces:
Serializable, Comparable<NumberingSystem>, Constable

public enum NumberingSystem extends Enum<NumberingSystem>
The digits a formatted number is written in: one zero code point and its nine successors, which is all a decimal numbering system is. Resolved from the UI language by I18n.numberingSystem() and applied at format time through I18n.localizeDigits(java.lang.String); nothing at the shaping or drawing layer knows this type exists (ADR 033).

DEVA is never chosen automatically — CLDR defaults Hindi to Latin digits — and is reachable through I18n.setNumberingSystem(limn.i18n.NumberingSystem), which is why it is here and in the glyph coverage test rather than in the locale table. Further systems are a constant and a table row away, behind the same coverage test.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Arabic-Indic ٠–٩ (U+0660–0669): Arabic outside the Maghreb.
    Extended Arabic-Indic ۰–۹ (U+06F0–06F9): Persian and Pashto.
    Devanagari ०–९ (U+0966–096F): by explicit override only.
    ASCII 0–9: the default, and the system every parse normalizes to.
  • Method Summary

    Modifier and Type
    Method
    Description
    char
    digit(int value)
    The digit value (0–9) is written as in this system.
    static int
    digitValue(int codepoint)
    The numeric value of codepoint in any system this enum knows, or -1.
    forLocale(Locale locale)
    CLDR's default system for locale, over the languages whose script faces the toolkit vendors.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LATN

      public static final NumberingSystem LATN
      ASCII 0–9: the default, and the system every parse normalizes to.
    • ARAB

      public static final NumberingSystem ARAB
      Arabic-Indic ٠–٩ (U+0660–0669): Arabic outside the Maghreb.
    • ARABEXT

      public static final NumberingSystem ARABEXT
      Extended Arabic-Indic ۰–۹ (U+06F0–06F9): Persian and Pashto.
    • DEVA

      public static final NumberingSystem DEVA
      Devanagari ०–९ (U+0966–096F): by explicit override only.
  • Method Details

    • values

      public static NumberingSystem[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NumberingSystem valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • digit

      public char digit(int value)
      The digit value (0–9) is written as in this system.
    • digitValue

      public static int digitValue(int codepoint)
      The numeric value of codepoint in any system this enum knows, or -1. Deliberately not restricted to one system: a parse that folded only the active system's digits would reject a pasted value the moment the locale changed under it.
    • forLocale

      public static NumberingSystem forLocale(Locale locale)
      CLDR's default system for locale, over the languages whose script faces the toolkit vendors. Arabic defaults to ARAB except in the Maghreb, which writes Latin digits; Persian and Pashto to ARABEXT; everything else — Hebrew and Hindi included, per CLDR — to LATN.