java.text.NumberFormat#getAvailableLocales ( )源码实例Demo

下面列出了java.text.NumberFormat#getAvailableLocales ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: arx   文件: DataType.java
/**
 * Provides a list of example formats for the <code>Decimal</code> data type.
 *
 * @return
 */
private static List<String> listDecimalFormats(){
    List<String> result = new ArrayList<String>();
    result.add("0.###");
    result.add("0.00");
    result.add("#,##0.###");
    result.add("#,##0.00");
    result.add("#,##0");
    result.add("#,##0%");
    
    // Create list of common patterns
    Set<String> set = new HashSet<String>();
    set.addAll(result);
    for (Locale locale: NumberFormat.getAvailableLocales()) {
        for (NumberFormat format : new NumberFormat[] { NumberFormat.getNumberInstance(locale),
                                                        NumberFormat.getIntegerInstance(locale),
                                                        NumberFormat.getCurrencyInstance(locale),
                                                        NumberFormat.getPercentInstance(locale) }) {

            // Add pattern
            if (format instanceof DecimalFormat) {
                String pattern = ((DecimalFormat)format).toPattern();
                if (!set.contains(pattern)) {
                    set.add(pattern);
                    result.add(pattern);
                }
            }
        }
        
    }
    return result;
}
 
源代码2 项目: astor   文件: ExtendedMessageFormatTest.java
/**
 * Test the built in number formats.
 */
@Test
public void testBuiltInNumberFormat() {
    final Object[] args = new Object[] {Double.valueOf("6543.21")};
    final Locale[] availableLocales = NumberFormat.getAvailableLocales();
    checkBuiltInFormat("1: {0,number}",            args, availableLocales);
    checkBuiltInFormat("2: {0,number,integer}",    args, availableLocales);
    checkBuiltInFormat("3: {0,number,currency}",   args, availableLocales);
    checkBuiltInFormat("4: {0,number,percent}",    args, availableLocales);
    checkBuiltInFormat("5: {0,number,00000.000}",  args, availableLocales);
}
 
源代码3 项目: bcm-android   文件: BtcFormat.java
/**
 * Return an array of all locales for which the getInstance() method of this class can
 * return localized instances.  See {@link NumberFormat#getAvailableLocales()}
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码4 项目: astor   文件: ComplexFormat.java
/**
 * Get the set of locales for which complex formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码5 项目: astor   文件: Vector3DFormat.java
/**
 * Get the set of locales for which 3D vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available 3D vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码6 项目: astor   文件: RealMatrixFormat.java
/**
 * Get the set of locales for which real vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available real vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码7 项目: astor   文件: FractionFormat.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set. 
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码8 项目: astor   文件: Vector3DFormat.java
/**
 * Get the set of locales for which 3D vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available 3D vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码9 项目: astor   文件: FractionFormat.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set.
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码10 项目: astor   文件: RealVectorFormat.java
/**
 * Get the set of locales for which real vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available real vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码11 项目: astor   文件: ComplexFormat.java
/**
 * Get the set of locales for which complex formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p> 
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码12 项目: astor   文件: FractionFormat.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set.
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码13 项目: astor   文件: BigFractionFormat.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set.
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码14 项目: coming   文件: Cardumen_0032_s.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set. 
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码15 项目: coming   文件: Cardumen_0032_t.java
/**
 * Get the set of locales for which complex formats are available.  This
 * is the same set as the {@link NumberFormat} set. 
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码16 项目: astor   文件: RealVectorFormat.java
/**
 * Get the set of locales for which real vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available real vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码17 项目: astor   文件: VectorFormat.java
/**
 * Get the set of locales for which point/vector formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available point/vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码18 项目: astor   文件: RealVectorFormat.java
/**
 * Get the set of locales for which real vectors formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available real vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码19 项目: astor   文件: VectorFormat.java
/**
 * Get the set of locales for which point/vector formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available point/vector format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}
 
源代码20 项目: astor   文件: ComplexFormat.java
/**
 * Get the set of locales for which complex formats are available.
 * <p>This is the same set as the {@link NumberFormat} set.</p>
 * @return available complex format locales.
 */
public static Locale[] getAvailableLocales() {
    return NumberFormat.getAvailableLocales();
}