FileDocCategorySizeDatePackage
FormatAbstractionLayerImpl.javaAPI DocphoneME MR2 API (J2ME)2897Wed May 02 18:00:46 BST 2007com.sun.j2me.global

FormatAbstractionLayerImpl

public class FormatAbstractionLayerImpl extends FormatAbstractionLayer
This class customizes the {@link javax.microedition.global.Formatter} implementation to the emulator needs.

Fields Summary
Constructors Summary
public FormatAbstractionLayerImpl()
Create instance of FormatAbstractionLayerImpl. This constructor is necessary because of Class.forName() creation call in {@link com.sun.j2me.global.FormatAbstractionLayer#getInstance}.

 
Methods Summary
public CommonFormattergetFormatter(java.lang.String locale)
Returns an instance of the FormatterImpl class, which realizes most of Formatter methods.

param
locale the locale to use with this Formatter
return
the instance of the FormatterImpl

        return new FormatterImpl(locale);
    
public java.lang.String[]getSupportedLocales()
Gets the list of the locales supported by the formatter, as an array of valid microedition.locale values.

If no locales are supported, the list MUST be empty. It MUST NOT be null. As the value null is not technically a valid locale, but a special value to trigger locale-neutral formatting, it MUST NOT appear in the array.

return
an array of strings containing the locale values

        String[] locales;
        String[] res_locales =
                ResourceManager.getSupportedLocales(ResourceManager.DEVICE);
        if (res_locales[0].equals("")) {
            int len = res_locales.length - 1;
            locales = new String[len];
            System.arraycopy(res_locales, 1, locales, 0, len);
            return locales;
        }
        return res_locales;