/** * Returns a DecimalFormatSymbols instance for the default locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols()</code>. ICU currently does not * support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java 6. * * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance() { return new DecimalFormatSymbols(); }
/** * Returns a DecimalFormatSymbols instance for the default locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols()</code>. ICU currently does not * support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java 6. * * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance() { return new DecimalFormatSymbols(); }
/** * Returns a DecimalFormatSymbols instance for the default locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols()</code>. ICU currently does not * support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java 6. * * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance() { return new DecimalFormatSymbols(); }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(ULocale locale) { return new DecimalFormatSymbols(locale); }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(ULocale locale) { return new DecimalFormatSymbols(locale); }
/** * Returns the DecimalFormatSymbols object that should be used by all DecimalFormat * instances owned by this formatter. This object is lazily created: this function * creates it the first time it's called. * @return The DecimalFormatSymbols object that should be used by all DecimalFormat * instances owned by this formatter. */ DecimalFormatSymbols getDecimalFormatSymbols() { // lazy-evaluate the DecimalFormatSymbols object. This object // is shared by all DecimalFormat instances belonging to this // formatter if (decimalFormatSymbols == null) { decimalFormatSymbols = new DecimalFormatSymbols(locale); } return decimalFormatSymbols; }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(Locale locale) { return new DecimalFormatSymbols(locale); }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(ULocale locale) { return new DecimalFormatSymbols(locale); }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(Locale locale) { return new DecimalFormatSymbols(locale); }
/** * Returns a DecimalFormatSymbols instance for the given locale. * * <p><strong>Note:</strong> Unlike * <code>java.text.DecimalFormatSymbols#getInstance</code>, this method simply returns * <code>new com.ibm.icu.text.DecimalFormatSymbols(locale)</code>. ICU currently does * not support <code>DecimalFormatSymbolsProvider</code>, which was introduced in Java * 6. * * @param locale the locale. * @return A DecimalFormatSymbols instance. * @stable ICU 3.8 */ public static DecimalFormatSymbols getInstance(Locale locale) { return new DecimalFormatSymbols(locale); }
com.ibm.icu.text.DecimalFormatSymbols dfs = new com.ibm.icu.text.DecimalFormatSymbols(); dfs.setGroupingSeparator(' '); com.ibm.icu.text.DecimalFormat df = new com.ibm.icu.text.DecimalFormat("0,000000,0", dfs);
/** * Standard override. * @stable ICU 2.0 */ public Object clone() { return new DecimalFormatSymbols((java.text.DecimalFormatSymbols)dfs.clone()); }
/** * Standard override. * @stable ICU 2.0 */ public Object clone() { return new DecimalFormatSymbols((java.text.DecimalFormatSymbols)dfs.clone()); }
/** * Returns a copy of the decimal format symbols used by this format. * * @return desired DecimalFormatSymbols * @see DecimalFormatSymbols * @stable ICU 2.0 */ public DecimalFormatSymbols getDecimalFormatSymbols() { return new DecimalFormatSymbols(((java.text.DecimalFormat)numberFormat).getDecimalFormatSymbols()); }
/** * Overrides clone. * @stable ICU 2.0 */ public Object clone() { return new DecimalFormatSymbols((java.text.DecimalFormatSymbols)numberFormat.clone()); }
/** * Returns a copy of the decimal format symbols used by this format. * * @return desired DecimalFormatSymbols * @see DecimalFormatSymbols * @stable ICU 2.0 */ public DecimalFormatSymbols getDecimalFormatSymbols() { return new DecimalFormatSymbols(((java.text.DecimalFormat)numberFormat).getDecimalFormatSymbols()); }
/** * Overrides clone. * @stable ICU 2.0 */ public Object clone() { return new DecimalFormatSymbols((java.text.DecimalFormatSymbols)numberFormat.clone()); }
private void setDecimalSymbols(ULocale uLocale) { // decimal point for seconds DecimalFormatSymbols dfs = new DecimalFormatSymbols(uLocale); setDecimal(String.valueOf(dfs.getDecimalSeparator())); }
/** * Update the currency object to match the symbols. This method is used only when the * caller has passed in a symbols object that may not be the default object for its * locale. */ private void setCurrencyForSymbols() { // Bug 4212072 Update the affix strings according to symbols in order to keep the // affix strings up to date. [Richard/GCL] // With the introduction of the Currency object, the currency symbols in the DFS // object are ignored. For backward compatibility, we check any explicitly set DFS // object. If it is a default symbols object for its locale, we change the // currency object to one for that locale. If it is custom, we set the currency to // null. DecimalFormatSymbols def = new DecimalFormatSymbols(symbols.getULocale()); if (symbols.getCurrencySymbol().equals(def.getCurrencySymbol()) && symbols.getInternationalCurrencySymbol() .equals(def.getInternationalCurrencySymbol())) { setCurrency(Currency.getInstance(symbols.getULocale())); } else { setCurrency(null); } }
/** * Creates a DecimalFormat from the given pattern and the symbols for the default * <code>FORMAT</code> locale. This is a convenient way to obtain a DecimalFormat when * internationalization is not the main concern. * * <p>To obtain standard formats for a given locale, use the factory methods on * NumberFormat such as getNumberInstance. These factories will return the most * appropriate sub-class of NumberFormat for a given locale. * * @param pattern A non-localized pattern string. * @throws IllegalArgumentException if the given pattern is invalid. * @see NumberFormat#getInstance * @see NumberFormat#getNumberInstance * @see NumberFormat#getCurrencyInstance * @see NumberFormat#getPercentInstance * @see Category#FORMAT * @stable ICU 2.0 */ public DecimalFormat(String pattern) { // Always applyPattern after the symbols are set ULocale def = ULocale.getDefault(Category.FORMAT); this.symbols = new DecimalFormatSymbols(def); setCurrency(Currency.getInstance(def)); applyPatternWithoutExpandAffix(pattern, false); if (currencySignCount == CURRENCY_SIGN_COUNT_IN_PLURAL_FORMAT) { currencyPluralInfo = new CurrencyPluralInfo(def); } else { expandAffixAdjustWidth(null); } }