1 /* 2 ******************************************************************************* 3 * Copyright (C) 2008-2012, International Business Machines Corporation and * 4 * others. All Rights Reserved. * 5 ******************************************************************************* 6 */ 7 package com.ibm.icu.impl.javaspi.text; 8 9 import java.text.Collator; 10 import java.text.spi.CollatorProvider; 11 import java.util.Locale; 12 13 import com.ibm.icu.impl.javaspi.ICULocaleServiceProvider; 14 import com.ibm.icu.impl.jdkadapter.CollatorICU; 15 16 public class CollatorProviderICU extends CollatorProvider { 17 18 @Override getInstance(Locale locale)19 public Collator getInstance(Locale locale) { 20 com.ibm.icu.text.Collator icuCollator = com.ibm.icu.text.Collator.getInstance( 21 ICULocaleServiceProvider.toULocaleNoSpecialVariant(locale)); 22 return CollatorICU.wrap(icuCollator); 23 } 24 25 @Override getAvailableLocales()26 public Locale[] getAvailableLocales() { 27 return ICULocaleServiceProvider.getAvailableLocales(); 28 } 29 30 } 31