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


Java ULocale.toString方法代码示例

本文整理汇总了Java中com.ibm.icu.util.ULocale.toString方法的典型用法代码示例。如果您正苦于以下问题:Java ULocale.toString方法的具体用法?Java ULocale.toString怎么用?Java ULocale.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.icu.util.ULocale的用法示例。


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

示例1: getFrozenInstance

import com.ibm.icu.util.ULocale; //导入方法依赖的package包/类
/**
 * Construct a frozen instance of DateTimePatternGenerator for a
 * given locale.  This method returns a cached frozen instance of
 * DateTimePatternGenerator, so less expensive than the regular
 * factory method.
 * @param uLocale The locale to pass.
 * @return A frozen DateTimePatternGenerator.
 * @internal
 * @deprecated This API is ICU internal only.
 */
@Deprecated
public static DateTimePatternGenerator getFrozenInstance(ULocale uLocale) {
    String localeKey = uLocale.toString();
    DateTimePatternGenerator result = DTPNG_CACHE.get(localeKey);
    if (result != null) {
        return result;
    }

    result = new DateTimePatternGenerator();
    result.initData(uLocale);

    // freeze and cache
    result.freeze();
    DTPNG_CACHE.put(localeKey, result);
    return result;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:27,代码来源:DateTimePatternGenerator.java

示例2: initializePattern

import com.ibm.icu.util.ULocale; //导入方法依赖的package包/类
private void initializePattern(ICUCache<String, Map<String, PatternInfo>> cache) { 
    String fullPattern = fDateFormat.toPattern();
    ULocale locale = fDateFormat.getLocale();
    String key = null;
    Map<String, PatternInfo> patterns = null;
    if (cache != null) {
        if ( fSkeleton != null ) {
            key = locale.toString() + "+" + fullPattern + "+" + fSkeleton;
        } else {
            key = locale.toString() + "+" + fullPattern;
        }
        patterns = cache.get(key);
    }
    if (patterns == null) {
        Map<String, PatternInfo> intervalPatterns = initializeIntervalPattern(fullPattern, locale);
        patterns = Collections.unmodifiableMap(intervalPatterns);
        if (cache != null) {
            cache.put(key, patterns);
        }
    } 
    fIntervalPatterns = patterns;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:23,代码来源:DateIntervalFormat.java

示例3: initializeData

import com.ibm.icu.util.ULocale; //导入方法依赖的package包/类
private void initializeData(ULocale locale)
{
    String key = locale.toString();
    DateIntervalInfo dii = DIICACHE.get(key);
    if ( dii == null ) {
        // initialize data from scratch
        setup(locale);
        // Marking fIntervalPatterns read-only makes cloning cheaper.
        fIntervalPatternsReadOnly = true;
        // We freeze what goes in the cache without freezing this object.
        DIICACHE.put(key, ((DateIntervalInfo) clone()).freeze());
    } else {
        initializeFromReadOnlyPatterns(dii);
    }
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:16,代码来源:DateIntervalInfo.java

示例4: get

import com.ibm.icu.util.ULocale; //导入方法依赖的package包/类
public RelativeDateTimeFormatterData get(ULocale locale) {
    String key = locale.toString();
    return cache.getInstance(key, locale);
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:5,代码来源:RelativeDateTimeFormatter.java

示例5: get

import com.ibm.icu.util.ULocale; //导入方法依赖的package包/类
/**
 * Returns a collation-based scanner.
 *
 * Only primary differences are treated as significant.  This means that case
 * differences, accent differences, alternate spellings of the same letter
 * (e.g., ae and a-umlaut in German), ignorable characters, etc. are ignored in
 * matching the text.  In many cases, numerals will be accepted in place of words
 * or phrases as well.
 *
 * For example, all of the following will correctly parse as 255 in English in
 * lenient-parse mode:
 * <br>"two hundred fifty-five"
 * <br>"two hundred fifty five"
 * <br>"TWO HUNDRED FIFTY-FIVE"
 * <br>"twohundredfiftyfive"
 * <br>"2 hundred fifty-5"
 *
 * The Collator used is determined by the locale that was
 * passed to this object on construction.  The description passed to this object
 * on construction may supply additional collation rules that are appended to the
 * end of the default collator for the locale, enabling additional equivalences
 * (such as adding more ignorable characters or permitting spelled-out version of
 * symbols; see the demo program for examples).
 *
 * It's important to emphasize that even strict parsing is relatively lenient: it
 * will accept some text that it won't produce as output.  In English, for example,
 * it will correctly parse "two hundred zero" and "fifteen hundred".
 * 
 * @internal
 * @deprecated This API is ICU internal only.
 */
@Deprecated
public RbnfLenientScanner get(ULocale locale, String extras) {
    RbnfLenientScanner result = null;
    String key = locale.toString() + "/" + extras;
    synchronized(cache) {
        result = cache.get(key);
        if (result != null) {
            return result;
        }
    }
    result = createScanner(locale, extras);
    synchronized(cache) {
        cache.put(key, result);
    }
    return result;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:48,代码来源:RbnfScannerProviderImpl.java


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