harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvj...@apache.org
Subject svn commit: r648199 - /harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/
Date Tue, 15 Apr 2008 09:54:33 GMT
Author: lvjing
Date: Tue Apr 15 02:54:23 2008
New Revision: 648199

URL: http://svn.apache.org/viewvc?rev=648199&view=rev
Log:
Apply patch for HARMONY-5732,[classlib][text][java6] Add provider classes for java.text.spi

Added:
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java
  (with props)
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java
  (with props)
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java
  (with props)
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java
  (with props)
Modified:
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java

Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java?rev=648199&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java
Tue Apr 15 02:54:23 2008
@@ -0,0 +1,98 @@
+/* 
+ * 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 provider which provides
+ * instances of <code>BreakIterator</code> class.
+ */
+public abstract class BreakIteratorProvider extends LocaleServiceProvider {
+
+    /**
+     * The constructor
+     * 
+     */
+    protected BreakIteratorProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Get an instance of <code>BreakIterator</code> for word breaks for the
+     * given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an intance of <code>BreakIterator</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getWordInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>BreakIterator</code> for line breaks for the
+     * given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>BreakIterator</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getLineInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>BreakIterator</code> for character breaks for
+     * the given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>BreakIterator</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getCharacterInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>BreakIterator</code> for sentence breaks for
+     * the given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>BreakIterator</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract BreakIterator getSentenceInstance(Locale locale);
+
+}

Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/BreakIteratorProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java?rev=648199&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java
Tue Apr 15 02:54:23 2008
@@ -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.Collator;
+import java.util.Locale;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This abstract class should be extended by service provider which provides
+ * instances of <code>Collator</code> class.
+ */
+public abstract class CollatorProvider extends LocaleServiceProvider {
+
+    /**
+     * The constructor
+     * 
+     */
+    protected CollatorProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Get an instance of <code>Collator</code> for the given locale
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>Collator</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract Collator getInstance(Locale locale);
+}

Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/CollatorProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java?rev=648199&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java
Tue Apr 15 02:54:23 2008
@@ -0,0 +1,91 @@
+/* 
+ * 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 provider which provides
+ * instances of <code>DateFormat</code> class.
+ */
+public abstract class DateFormatProvider extends LocaleServiceProvider {
+
+    /**
+     * The constructor
+     * 
+     */
+    protected DateFormatProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Get an instance of <code>DateFormat</code> class which formats time
+     * with the given formatting style for the given locale
+     * 
+     * @param style
+     *            the given formatting style.
+     * @param locale
+     *            the desired locale
+     * @return an instance of <code>DateFormat</code> class
+     * @throws IllegalArgumentException
+     *             if style is invalid, or if locale isn't one of the locales
+     *             returned from getAvailableLocales().
+     * @throws NullPointerException
+     *             if locale is null
+     */
+    public abstract DateFormat getTimeInstance(int style, Locale locale);
+
+    /**
+     * Get an instance of <code>DateFormat</code> class which formats date
+     * with the given formatting style for the given locale
+     * 
+     * @param style
+     *            the given formatting style.
+     * @param locale
+     *            the desired locale
+     * @return an instance of <code>DateFormat</code> class
+     * @throws IllegalArgumentException
+     *             if style is invalid, or if locale isn't one of the locales
+     *             returned from getAvailableLocales().
+     * @throws NullPointerException
+     *             if locale is null
+     */
+    public abstract DateFormat getDateInstance(int style, Locale locale);
+
+    /**
+     * Get an instance of <code>DateFormat</code> class which formats date and
+     * time with the given formatting style for the given locale
+     * 
+     * @param dateStyle
+     *            the given date formatting style.
+     * @param timeStyle
+     *            the given time formatting style.
+     * @param locale
+     *            the desired locale
+     * @return an instance of <code>DateFormat</code> class
+     * @throws IllegalArgumentException
+     *             if dateStyle or timeStyle is invalid, or if locale isn't one
+     *             of the locales returned from getAvailableLocales().
+     * @throws NullPointerException
+     *             if locale is null
+     */
+    public abstract DateFormat getDateTimeInstance(int dateStyle,
+            int timeStyle, Locale locale);
+}

Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java?rev=648199&r1=648198&r2=648199&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
Tue Apr 15 02:54:23 2008
@@ -22,23 +22,30 @@
 import java.util.spi.LocaleServiceProvider;
 
 /**
- * This abstract class should be extended by service provider which provide
+ * This abstract class should be extended by service provider which provides
  * instances of <code>DateFormatSymbols</code> class.
  * 
  */
 public abstract class DateFormatSymbolsProvider extends LocaleServiceProvider {
 
+    /**
+     * The constructor
+     *
+     */
     protected DateFormatSymbolsProvider() {
-        super();
+        // Do nothing.
     }
 
     /**
-     * Get an instance of <code>DateFormatSymbols</code> with specified
+     * Get an instance of <code>DateFormatSymbols</code> with the specified
      * locale.
      * 
      * @param locale
      *            the specified locale
      * @return a <code>DateFormatSymbols</code> instance
+     * @throws NullPointerException, if locale is null 
+     * @throws IllegalArgumentException, if locale isn't one of the locales 
+     *            returned from getAvailableLocales().
      */
     public abstract DateFormatSymbols getInstance(Locale locale);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java?rev=648199&r1=648198&r2=648199&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
Tue Apr 15 02:54:23 2008
@@ -22,14 +22,18 @@
 import java.util.spi.LocaleServiceProvider;
 
 /**
- * This abstract class should be extended by service provider which provide
+ * This abstract class should be extended by service provider which provides
  * instances of <code>DecimalFormatSymbols</code> class.
  */
 public abstract class DecimalFormatSymbolsProvider extends
         LocaleServiceProvider {
 
+    /**
+     * The constructor
+     *
+     */
     protected DecimalFormatSymbolsProvider() {
-        super();
+        // Do nothing.
     }
 
     /**
@@ -39,6 +43,9 @@
      * @param locale
      *            the specified locale
      * @return a <code>DecimalFormatSymbols</code> instance
+     * @throws NullPointerException, if locale is null 
+     * @throws IllegalArgumentException, if locale isn't one of the locales 
+     *            returned from getAvailableLocales().
      */
     public abstract DecimalFormatSymbols getInstance(Locale locale);
 

Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java?rev=648199&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java
Tue Apr 15 02:54:23 2008
@@ -0,0 +1,100 @@
+/* 
+ * 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 provider which provides
+ * instances of <code>NumberFormat</code> class.
+ */
+public abstract class NumberFormatProvider extends LocaleServiceProvider {
+
+    /**
+     * The constructor
+     * 
+     */
+    protected NumberFormatProvider() {
+        // Do nothing.
+    }
+
+    /**
+     * Get an instance of <code>NumberFormat</code> class which formats
+     * monetary values for the given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>NumberFormat</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getCurrencyInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>NumberFormat</code> class which formats
+     * integer values for the given locale. The returned number format instance
+     * 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 specified locale
+     * @return an instance of <code>NumberFormat</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getIntegerInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>NumberFormat</code> class which is for general
+     * use for the given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>NumberFormat</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getNumberInstance(Locale locale);
+
+    /**
+     * Get an instance of <code>NumberFormat</code> class which formats
+     * percentage values for the given locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return an instance of <code>NumberFormat</code> class
+     * @throws NullPointerException,
+     *             if locale is null
+     * @throws IllegalArgumentException,
+     *             if locale isn't one of the locales returned from
+     *             getAvailableLocales().
+     */
+    public abstract NumberFormat getPercentInstance(Locale locale);
+}

Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/NumberFormatProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message