Java 类java.text.spi.CollatorProvider 实例源码

项目:openjdk-jdk10    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<CollatorProvider>) () ->
                new CollatorProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("CollationData")));

        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:openjdk9    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<CollatorProvider>) () ->
                new CollatorProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("CollationData")));

        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:VarJ    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale, 
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:jdk-1.7-annotated    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:jdk7-jdk    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:openjdk-source-code-learn    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:openjdk-jdk7u-jdk    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:openjdk-icedtea7    文件:Collator.java   
public Collator getObject(CollatorProvider collatorProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 1;
    Collator result = collatorProvider.getInstance(locale);
    if (result != null) {
        // put this Collator instance in the cache for two locales, one
        // is for the desired locale, and the other is for the actual
        // locale where the provider is found, which may be a fall back locale.
        cache.put((Locale)params[0], result);
        cache.put(locale, result);
        return (Collator)result.clone();
    }

    return null;
}
项目:OpenJSharp    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:OpenJSharp    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:jdk8u-jdk    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:jdk8u-jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:openjdk-jdk10    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:openjdk9    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:Java8CN    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:NonDex    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:jdk8u_jdk    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:jdk8u_jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:lookaside_java-1.8.0-openjdk    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:lookaside_java-1.8.0-openjdk    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:infobip-open-jdk-8    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:infobip-open-jdk-8    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:jdk8u-dev-jdk    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:jdk8u-dev-jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:OLD-OpenJDK8    文件:Collator.java   
/**
 * Gets the Collator for the desired locale.
 * @param desiredLocale the desired locale.
 * @return the Collator for the desired locale.
 * @see java.util.Locale
 * @see java.util.ResourceBundle
 */
public static Collator getInstance(Locale desiredLocale) {
    SoftReference<Collator> ref = cache.get(desiredLocale);
    Collator result = (ref != null) ? ref.get() : null;
    if (result == null) {
        LocaleProviderAdapter adapter;
        adapter = LocaleProviderAdapter.getAdapter(CollatorProvider.class,
                                                   desiredLocale);
        CollatorProvider provider = adapter.getCollatorProvider();
        result = provider.getInstance(desiredLocale);
        if (result == null) {
            result = LocaleProviderAdapter.forJRE()
                         .getCollatorProvider().getInstance(desiredLocale);
        }
        while (true) {
            if (ref != null) {
                // Remove the empty SoftReference if any
                cache.remove(desiredLocale, ref);
            }
            ref = cache.putIfAbsent(desiredLocale, new SoftReference<>(result));
            if (ref == null) {
                break;
            }
            Collator cachedColl = ref.get();
            if (cachedColl != null) {
                result = cachedColl;
                break;
            }
        }
    }
    return (Collator) result.clone(); // make the world safe
}
项目:OLD-OpenJDK8    文件:JRELocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    if (collatorProvider == null) {
        CollatorProvider provider = new CollatorProviderImpl(getAdapterType(),
                                            getLanguageTagSet("CollationData"));
        synchronized (this) {
            if (collatorProvider == null) {
                collatorProvider = provider;
            }
        }
    }
    return collatorProvider;
}
项目:OpenJSharp    文件:AuxLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return getLocaleServiceProvider(CollatorProvider.class);
}
项目:OpenJSharp    文件:SPILocaleProviderAdapter.java   
@Override
public void addImpl(CollatorProvider impl) {
    for (Locale l : impl.getAvailableLocales()) {
        map.putIfAbsent(l, impl);
    }
}
项目:OpenJSharp    文件:SPILocaleProviderAdapter.java   
@Override
public CollatorProvider getImpl(Locale locale) {
    return SPILocaleProviderAdapter.getImpl(map, locale);
}
项目:OpenJSharp    文件:CLDRLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return null;
}
项目:jdk8u-jdk    文件:AuxLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return getLocaleServiceProvider(CollatorProvider.class);
}
项目:jdk8u-jdk    文件:SPILocaleProviderAdapter.java   
@Override
public void addImpl(CollatorProvider impl) {
    for (Locale l : impl.getAvailableLocales()) {
        map.putIfAbsent(l, impl);
    }
}
项目:jdk8u-jdk    文件:SPILocaleProviderAdapter.java   
@Override
public CollatorProvider getImpl(Locale locale) {
    return SPILocaleProviderAdapter.getImpl(map, locale);
}
项目:jdk8u-jdk    文件:CLDRLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return null;
}
项目:openjdk-jdk10    文件:AuxLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return getLocaleServiceProvider(CollatorProvider.class);
}
项目:openjdk-jdk10    文件:SPILocaleProviderAdapter.java   
@Override
public void addImpl(CollatorProvider impl) {
    for (Locale l : impl.getAvailableLocales()) {
        map.putIfAbsent(l, impl);
    }
}
项目:openjdk-jdk10    文件:SPILocaleProviderAdapter.java   
@Override
public CollatorProvider getImpl(Locale locale) {
    return SPILocaleProviderAdapter.getImpl(map, locale);
}
项目:openjdk-jdk10    文件:CLDRLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return null;
}
项目:openjdk9    文件:AuxLocaleProviderAdapter.java   
@Override
public CollatorProvider getCollatorProvider() {
    return getLocaleServiceProvider(CollatorProvider.class);
}
项目:openjdk9    文件:SPILocaleProviderAdapter.java   
@Override
public void addImpl(CollatorProvider impl) {
    for (Locale l : impl.getAvailableLocales()) {
        map.putIfAbsent(l, impl);
    }
}