当前位置: 首页>>代码示例>>Java>>正文


Java Utils类代码示例

本文整理汇总了Java中com.foobar.Utils的典型用法代码示例。如果您正苦于以下问题:Java Utils类的具体用法?Java Utils怎么用?Java Utils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Utils类属于com.foobar包,在下文中一共展示了Utils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSymbol

import com.foobar.Utils; //导入依赖的package包/类
public String getSymbol(String c, Locale locale) {
    if (!Utils.supportsLocale(Arrays.asList(avail), locale)) {
        throw new IllegalArgumentException("locale is not supported: "+locale);
    }

    if (c.equals("JPY")) {
        if (Utils.supportsLocale(avail[0], locale)) {
            return "\u5186\u3084\u3002";
        } else if (Utils.supportsLocale(avail[1], locale)) {
            return "\u5186\u3069\u3059\u3002";
        } else if (Utils.supportsLocale(avail[2], locale)) {
            return "\u5186\u3067\u3059\u3002";
        } else if (Utils.supportsLocale(avail[3], locale)) {
            return "\u5186\u3070\u3064\u3070\u3064\u3002";
        }
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:CurrencyNameProviderImpl.java

示例2: getDisplayName

import com.foobar.Utils; //导入依赖的package包/类
@Override
public String getDisplayName(String c, Locale locale) {
    if (!Utils.supportsLocale(Arrays.asList(avail), locale)) {
        throw new IllegalArgumentException("locale is not supported: "+locale);
    }

    if (c.equals("JPY")) {
        if (Utils.supportsLocale(avail[0], locale)) {
            return "\u65e5\u672c\u5186\u3084\u3002";
        } else if (Utils.supportsLocale(avail[1], locale)) {
            return "\u65e5\u672c\u5186\u3069\u3059\u3002";
        } else if (Utils.supportsLocale(avail[2], locale)) {
            return "\u65e5\u672c\u5186\u3067\u3059\u3002";
        } else if (Utils.supportsLocale(avail[3], locale)) {
            return "\u65e5\u672c\u5186\u3070\u3064\u3070\u3064\u3002";
        }
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:CurrencyNameProviderImpl.java

示例3: getInstance

import com.foobar.Utils; //导入依赖的package包/类
public DateFormatSymbols getInstance(Locale locale) {
    if (!Utils.supportsLocale(availList, locale)) {
        throw new IllegalArgumentException("locale is not supported: "+locale);
    }

    FooDateFormatSymbols fdfs = symbols.get(locale);
    if (fdfs == null) {
        for (int index = 0; index < avail.length; index ++) {
            if (Utils.supportsLocale(avail[index], locale)) {
                fdfs = new FooDateFormatSymbols(index);
                symbols.put(locale, fdfs);
                break;
            }
        }
    }
    return fdfs;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:DateFormatSymbolsProviderImpl.java

示例4: getDisplayName

import com.foobar.Utils; //导入依赖的package包/类
public String getDisplayName(String id, boolean dst, int style, Locale language) {
    if (!Utils.supportsLocale(Arrays.asList(avail), language)) {
        throw new IllegalArgumentException("locale is not one of available locales: "+language);
    }

    for (int i = 0; i < avail.length; i ++) {
        if (Utils.supportsLocale(avail[i], language)) {
            String[][] namesForALocale = names[i];
            for (int j = 0; j < namesForALocale.length; j++) {
                String[] array = namesForALocale[j];
                if (id.equals(array[0])) {
                    String ret = array[(style==TimeZone.LONG?0:1)+(dst?2:0)+1];
                    return ret;
                }
            }
        }
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:TimeZoneNameProviderImpl.java

示例5: getIntegerInstance

import com.foobar.Utils; //导入依赖的package包/类
public NumberFormat getIntegerInstance(Locale locale) {
    for (int i = 0; i < avail.length; i ++) {
        if (Utils.supportsLocale(avail[i], locale)) {
            String pattern =
                MessageFormat.format(patterns[INTEGERSTYLE],
                                     dialect[i],
                                     dialect[i]);
            FooNumberFormat nf = new FooNumberFormat(pattern,
                DecimalFormatSymbols.getInstance(locale));
            nf.setMaximumFractionDigits(0);
            nf.setDecimalSeparatorAlwaysShown(false);
            nf.setParseIntegerOnly(true);
            return nf;
        }
    }
    throw new IllegalArgumentException("locale is not supported: "+locale);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:NumberFormatProviderImpl.java

示例6: getInstance

import com.foobar.Utils; //导入依赖的package包/类
public DecimalFormatSymbols getInstance(Locale locale) {
    if (!Utils.supportsLocale(availList, locale)) {
        throw new IllegalArgumentException("locale is not supported: "+locale);
    }

    FooDecimalFormatSymbols fdfs = symbols.get(locale);
    if (fdfs == null) {
        for (int index = 0; index < avail.length; index ++) {
            if (Utils.supportsLocale(avail[index], locale)) {
                fdfs = new FooDecimalFormatSymbols(index);
                symbols.put(locale, fdfs);
                break;
            }
        }
    }
    return fdfs;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:DecimalFormatSymbolsProviderImpl.java


注:本文中的com.foobar.Utils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。