Add the Java 6 java.text.spi and java.util.spi interfaces.

We don't currently use these, and don't necessarily plan to. Full support
would have a run-time cost, and it's not obvious that it would be particularly
useful.

Code search can't actually find any users of this stuff in the wild outside
of the various VM implementations and their test suites.

Bug: 2497395
Change-Id: Ie25aef73ece6d1fd169fdcb7b2f847761d77914d
diff --git a/luni/src/main/java/java/util/spi/CurrencyNameProvider.java b/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
new file mode 100644
index 0000000..90806c8
--- /dev/null
+++ b/luni/src/main/java/java/util/spi/CurrencyNameProvider.java
@@ -0,0 +1,49 @@
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one or more

+ *  contributor license agreements.  See the NOTICE file distributed with

+ *  this work for additional information regarding copyright ownership.

+ *  The ASF licenses this file to You under the Apache License, Version 2.0

+ *  (the "License"); you may not use this file except in compliance with

+ *  the License.  You may obtain a copy of the License at

+ *

+ *     http://www.apache.org/licenses/LICENSE-2.0

+ *

+ *  Unless required by applicable law or agreed to in writing, software

+ *  distributed under the License is distributed on an "AS IS" BASIS,

+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ *  See the License for the specific language governing permissions and

+ *  limitations under the License.

+ */

+

+package java.util.spi;

+

+import java.util.Locale;

+

+/**

+ * This abstract class should be extended by service providers that provide

+ * localized currency symbols (currency names) from currency codes.

+ * <p>Note that Android does not currently support user-supplied locale service providers.

+ * @since 1.6

+ * @hide

+ */

+public abstract class CurrencyNameProvider extends LocaleServiceProvider {

+    /**

+     * Default constructor, for use by subclasses.

+     */

+    protected CurrencyNameProvider() {

+        // do nothing

+    }

+

+    /**

+     * Returns the localized currency symbol for the given currency code.

+     * 

+     * @param code an ISO 4217 currency code

+     * @param locale a locale

+     * @return the symbol or null if there is no available symbol in the locale

+     * @throws NullPointerException

+     *             if {@code code == null || locale == null}

+     * @throws IllegalArgumentException

+     *             if code or locale is not in a legal format or not available

+     */

+    public abstract String getSymbol(String code, Locale locale);

+}

diff --git a/luni/src/main/java/java/util/spi/LocaleNameProvider.java b/luni/src/main/java/java/util/spi/LocaleNameProvider.java
new file mode 100644
index 0000000..099ef7d
--- /dev/null
+++ b/luni/src/main/java/java/util/spi/LocaleNameProvider.java
@@ -0,0 +1,75 @@
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one or more

+ *  contributor license agreements.  See the NOTICE file distributed with

+ *  this work for additional information regarding copyright ownership.

+ *  The ASF licenses this file to You under the Apache License, Version 2.0

+ *  (the "License"); you may not use this file except in compliance with

+ *  the License.  You may obtain a copy of the License at

+ *

+ *     http://www.apache.org/licenses/LICENSE-2.0

+ *

+ *  Unless required by applicable law or agreed to in writing, software

+ *  distributed under the License is distributed on an "AS IS" BASIS,

+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ *  See the License for the specific language governing permissions and

+ *  limitations under the License.

+ */

+

+package java.util.spi;

+

+import java.util.Locale;

+

+/**

+ * This abstract class should be extended by service providers that provide

+ * localized locale names.

+ * <p>Note that Android does not currently support user-supplied locale service providers.

+ * @since 1.6

+ * @hide

+ */

+public abstract class LocaleNameProvider extends LocaleServiceProvider {

+    /**

+     * Default constructor, for use by subclasses.

+     */

+    protected LocaleNameProvider() {

+        // do nothing

+    }

+

+    /**

+     * Returns the localized name for the given ISO 639 language code.

+     * 

+     * @param languageCode an ISO 639 language code

+     * @param locale a locale

+     * @return the name or null if unavailable

+     * @throws NullPointerException

+     *             if {@code code == null || locale == null}

+     * @throws IllegalArgumentException

+     *             if code or locale is not in a legal format or not available

+     */

+    public abstract String getDisplayLanguage(String languageCode, Locale locale);

+

+    /**

+     * Returns the localized name for the given ISO 3166 country code.

+     * 

+     * @param countryCode an ISO 3166 language code

+     * @param locale a locale

+     * @return the name or null if unavailable

+     * @throws NullPointerException

+     *             if {@code code == null || locale == null}

+     * @throws IllegalArgumentException

+     *             if code or locale is not in a legal format or not available

+     */

+    public abstract String getDisplayCountry(String countryCode, Locale locale);

+

+    /**

+     * Returns the localized name for the given variant code.

+     * 

+     * @param variantCode a variant code

+     * @param locale a locale

+     * @return the name or null if unavailable

+     * @throws NullPointerException

+     *             if {@code code == null || locale == null}

+     * @throws IllegalArgumentException

+     *             if code or locale is not in a legal format or not available

+     */

+    public abstract String getDisplayVariant(String variantCode, Locale locale);

+}

diff --git a/luni/src/main/java/java/util/spi/LocaleServiceProvider.java b/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
new file mode 100644
index 0000000..44f935b
--- /dev/null
+++ b/luni/src/main/java/java/util/spi/LocaleServiceProvider.java
@@ -0,0 +1,40 @@
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one or more

+ *  contributor license agreements.  See the NOTICE file distributed with

+ *  this work for additional information regarding copyright ownership.

+ *  The ASF licenses this file to You under the Apache License, Version 2.0

+ *  (the "License"); you may not use this file except in compliance with

+ *  the License.  You may obtain a copy of the License at

+ *

+ *     http://www.apache.org/licenses/LICENSE-2.0

+ *

+ *  Unless required by applicable law or agreed to in writing, software

+ *  distributed under the License is distributed on an "AS IS" BASIS,

+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ *  See the License for the specific language governing permissions and

+ *  limitations under the License.

+ */

+

+package java.util.spi;

+

+import java.util.Locale;

+

+/**

+ * The base class for all the locale related service provider interfaces (SPIs).

+ * <p>Note that Android does not currently support user-supplied locale service providers.

+ * @since 1.6

+ * @hide

+ */

+public abstract class LocaleServiceProvider {

+    /**

+     * Default constructor, for use by subclasses.

+     */

+    protected LocaleServiceProvider() {

+        // do nothing

+    }

+

+    /**

+     * Returns all locales for which this locale service provider has localized objects or names.

+     */

+    public abstract Locale[] getAvailableLocales();

+}

diff --git a/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java b/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java
new file mode 100644
index 0000000..e06192f
--- /dev/null
+++ b/luni/src/main/java/java/util/spi/TimeZoneNameProvider.java
@@ -0,0 +1,51 @@
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one or more

+ *  contributor license agreements.  See the NOTICE file distributed with

+ *  this work for additional information regarding copyright ownership.

+ *  The ASF licenses this file to You under the Apache License, Version 2.0

+ *  (the "License"); you may not use this file except in compliance with

+ *  the License.  You may obtain a copy of the License at

+ *

+ *     http://www.apache.org/licenses/LICENSE-2.0

+ *

+ *  Unless required by applicable law or agreed to in writing, software

+ *  distributed under the License is distributed on an "AS IS" BASIS,

+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ *  See the License for the specific language governing permissions and

+ *  limitations under the License.

+ */

+

+package java.util.spi;

+

+import java.util.Locale;

+

+/**

+ * This abstract class should be extended by service providers that provide

+ * localized time zone names.

+ * <p>Note that Android does not currently support user-supplied locale service providers.

+ * @since 1.6

+ * @hide

+ */

+public abstract class TimeZoneNameProvider extends LocaleServiceProvider {

+    /**

+     * Default constructor, for use by subclasses.

+     */

+    protected TimeZoneNameProvider() {

+        // do nothing

+    }

+

+    /**

+     * Returns the localized name for the given time zone in the given locale.

+     * 

+     * @param id the time zone id

+     * @param daylight true to return the name for daylight saving time.

+     * @param style TimeZone.LONG or TimeZone.SHORT

+     * @param locale the locale

+     * @return the readable time zone name, or null if it is unavailable

+     * @throws NullPointerException

+     *             if {@code id == null || locale == null}

+     * @throws IllegalArgumentException

+     *             if locale is not available or style is invalid

+     */

+    public abstract String getDisplayName(String id, boolean daylight, int style, Locale locale);

+}

diff --git a/text/src/main/java/java/text/BreakIterator.java b/text/src/main/java/java/text/BreakIterator.java
index 969a09e..b93f882 100644
--- a/text/src/main/java/java/text/BreakIterator.java
+++ b/text/src/main/java/java/text/BreakIterator.java
@@ -238,7 +238,7 @@
     NativeBreakIterator wrapped;
 
     /**
-     * Default constructor, just for invocation by a subclass.
+     * Default constructor, for use by subclasses.
      */
     protected BreakIterator() {
         super();
diff --git a/text/src/main/java/java/text/spi/BreakIteratorProvider.java b/text/src/main/java/java/text/spi/BreakIteratorProvider.java
new file mode 100644
index 0000000..70caeb2
--- /dev/null
+++ b/text/src/main/java/java/text/spi/BreakIteratorProvider.java
@@ -0,0 +1,89 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.BreakIterator;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers that provide
+ * instances of {@code BreakIterator}.
+ * @since 1.6
+ * @hide
+ */
+public abstract class BreakIteratorProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected BreakIteratorProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code BreakIterator} for word breaks in the
+     * given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code BreakIterator}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getWordInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code BreakIterator} for line breaks in the
+     * given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code BreakIterator}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getLineInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code BreakIterator} for character breaks in the
+     * given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code BreakIterator}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getCharacterInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code BreakIterator} for sentence breaks in the
+     * given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code BreakIterator}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getSentenceInstance(Locale locale);
+}
diff --git a/text/src/main/java/java/text/spi/CollatorProvider.java b/text/src/main/java/java/text/spi/CollatorProvider.java
new file mode 100644
index 0000000..8d234a1
--- /dev/null
+++ b/text/src/main/java/java/text/spi/CollatorProvider.java
@@ -0,0 +1,50 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.Collator;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers which provide
+ * instances of {@code Collator}.
+ * <p>Note that Android does not currently support user-supplied locale service providers.
+ * @since 1.6
+ * @hide
+ */
+public abstract class CollatorProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected CollatorProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code Collator} for the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code Collator}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract Collator getInstance(Locale locale);
+}
diff --git a/text/src/main/java/java/text/spi/DateFormatProvider.java b/text/src/main/java/java/text/spi/DateFormatProvider.java
new file mode 100644
index 0000000..ba17cb4
--- /dev/null
+++ b/text/src/main/java/java/text/spi/DateFormatProvider.java
@@ -0,0 +1,81 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.DateFormat;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers that provide
+ * instances of {@code DateFormat}.
+ * <p>Note that Android does not currently support user-supplied locale service providers.
+ * @since 1.6
+ * @hide
+ */
+public abstract class DateFormatProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected DateFormatProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code DateFormat} that formats times
+     * in the given style for the given locale.
+     * 
+     * @param style the given time formatting style.
+     * @param locale the locale
+     * @return an instance of {@code DateFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract DateFormat getTimeInstance(int style, Locale locale);
+
+    /**
+     * Returns an instance of {@code DateFormat} that formats dates
+     * in the given style for the given locale.
+     * 
+     * @param style the given date formatting style.
+     * @param locale the locale
+     * @return an instance of {@code DateFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract DateFormat getDateInstance(int style, Locale locale);
+
+    /**
+     * Returns an instance of {@code DateFormat} that formats dates and times
+     * in the given style for the given locale.
+     * 
+     * @param dateStyle the given date formatting style.
+     * @param timeStyle the given time formatting style.
+     * @param locale the locale
+     * @return an instance of {@code DateFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale);
+}
diff --git a/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java b/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
new file mode 100644
index 0000000..8467f05
--- /dev/null
+++ b/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
@@ -0,0 +1,50 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.DateFormatSymbols;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers that provide
+ * instances of {@code DateFormatSymbols}.
+ * <p>Note that Android does not currently support user-supplied locale service providers.
+ * @since 1.6
+ * @hide
+ */
+public abstract class DateFormatSymbolsProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected DateFormatSymbolsProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code DateFormatSymbols} for the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code DateFormatSymbols}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract DateFormatSymbols getInstance(Locale locale);
+}
diff --git a/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java b/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
new file mode 100644
index 0000000..81dbd4a
--- /dev/null
+++ b/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
@@ -0,0 +1,51 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers that provide
+ * instances of {@code DecimalFormatSymbols}.
+ * <p>Note that Android does not currently support user-supplied locale service providers.
+ * @since 1.6
+ * @hide
+ */
+public abstract class DecimalFormatSymbolsProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected DecimalFormatSymbolsProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code DecimalFormatSymbols} for the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code DecimalFormatSymbols}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract DecimalFormatSymbols getInstance(Locale locale);
+
+}
diff --git a/text/src/main/java/java/text/spi/NumberFormatProvider.java b/text/src/main/java/java/text/spi/NumberFormatProvider.java
new file mode 100644
index 0000000..f6d43e0
--- /dev/null
+++ b/text/src/main/java/java/text/spi/NumberFormatProvider.java
@@ -0,0 +1,93 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text.spi;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service providers that provide
+ * {@code NumberFormat} instances.
+ * <p>Note that Android does not currently support user-supplied locale service providers.
+ * @since 1.6
+ * @hide
+ */
+public abstract class NumberFormatProvider extends LocaleServiceProvider {
+    /**
+     * Default constructor, for use by subclasses.
+     */
+    protected NumberFormatProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Returns an instance of {@code NumberFormat} that formats
+     * monetary values for the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code NumberFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getCurrencyInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code NumberFormat} that formats
+     * integer values for the given locale. The returned {@code NumberFormat}
+     * is configured to round floating point numbers to the nearest integer
+     * using half-even rounding mode for formatting, and to parse only the
+     * integer part of an input string.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code NumberFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getIntegerInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code NumberFormat} class for general
+     * use in the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code NumberFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getNumberInstance(Locale locale);
+
+    /**
+     * Returns an instance of {@code NumberFormat} class that formats
+     * percentage values for the given locale.
+     * 
+     * @param locale the locale
+     * @return an instance of {@code NumberFormat}
+     * @throws NullPointerException if {@code locale == null}
+     * @throws IllegalArgumentException
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getPercentInstance(Locale locale);
+}