harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r648126 - in /harmony/enhanced/classlib/branches/java6/modules/text: META-INF/ src/main/java/java/text/ src/main/java/java/text/spi/
Date Tue, 15 Apr 2008 06:28:42 GMT
Author: tonywu
Date: Mon Apr 14 23:28:39 2008
New Revision: 648126

URL: http://svn.apache.org/viewvc?rev=648126&view=rev
Log:
Apply patch HARMONY-5721 with modification on Manifest ([java6][classlib][text] - add new
API in DateFormatSymbols and DecimalFormatSymbols)

Added:
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
  (with props)
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
  (with props)
Modified:
    harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
    harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java

Modified: harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF?rev=648126&r1=648125&r2=648126&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF Mon Apr 14
23:28:39 2008
@@ -22,6 +22,7 @@
  java.net,
  java.security,
  java.util,
+ java.util.spi,
  org.apache.harmony.kernel.vm,
  org.apache.harmony.luni.util,
  org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java?rev=648126&r1=648125&r2=648126&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
Mon Apr 14 23:28:39 2008
@@ -21,6 +21,8 @@
 import java.util.Arrays;
 import java.util.Locale;
 
+import org.apache.harmony.luni.util.NotImplementedException;
+
 /**
  * DateFormatSymbols holds the Strings used in the formating and parsing of
  * dates and times.
@@ -51,8 +53,9 @@
      *            the Locale
      */
     public DateFormatSymbols(Locale locale) {
-        com.ibm.icu.text.DateFormatSymbols icuSymbols = new com.ibm.icu.text.DateFormatSymbols(locale);
-        
+        com.ibm.icu.text.DateFormatSymbols icuSymbols = new com.ibm.icu.text.DateFormatSymbols(
+                locale);
+
         localPatternChars = icuSymbols.getLocalPatternChars();
         ampms = icuSymbols.getAmPmStrings();
         eras = icuSymbols.getEras();
@@ -61,6 +64,48 @@
         shortWeekdays = icuSymbols.getShortWeekdays();
         weekdays = icuSymbols.getWeekdays();
         zoneStrings = icuSymbols.getZoneStrings();
+    }
+
+    /**
+     * Get all locales which <code>getInstance(Locale)</code> method support
+     * to return localize instance. The returned array locales include Java
+     * runtime and installed service provider supported locales. And it must
+     * contain <code>Locale</code> instance equals to <code>Locale.US</code>.
+     * 
+     * @return array of locales
+     */
+    public static Locale[] getAvailableLocales() {
+        throw new NotImplementedException();
+    }
+
+    /**
+     * Return the DateFormatSymbols instance for the default locale.
+     * 
+     * @return an instance of DateFormatSymbols
+     * 
+     * @since 1.6
+     */
+    public static final DateFormatSymbols getInstance() {
+        throw new NotImplementedException();
+    }
+
+    /**
+     * Return the DateFormatSymbols for the specified locale. This method
+     * return DateFormatSymbols instances for locales supported by the Java
+     * runtime and installed DateFormatSymbols implementations.
+     * 
+     * @param locale
+     *            locale for the returned DateFormatSymbols instance
+     * 
+     * @return an instance of DateFormatSymbols
+     * 
+     * @exception NullPointerException
+     *                if locale is null
+     * 
+     * @since 1.6
+     */
+    public static final DateFormatSymbols getInstance(Locale locale) {
+        throw new NotImplementedException();
     }
 
     /**

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java?rev=648126&r1=648125&r2=648126&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
Mon Apr 14 23:28:39 2008
@@ -26,6 +26,8 @@
 import java.util.Currency;
 import java.util.Locale;
 
+import org.apache.harmony.luni.util.NotImplementedException;
+
 /**
  * DecimalFormatSymbols holds the symbols used in the formating and parsing of
  * numbers.
@@ -84,9 +86,52 @@
         patternChars[Percent] = icuSymbols.getPercent();
         patternChars[PerMill] = icuSymbols.getPerMill();
         patternChars[Exponent] = icuSymbols.getExponentSeparator().charAt(0);
-        patternChars[MonetaryDecimalSeparator] = icuSymbols.getMonetaryDecimalSeparator();
+        patternChars[MonetaryDecimalSeparator] = icuSymbols
+                .getMonetaryDecimalSeparator();
         patternChars[MinusSign] = icuSymbols.getMinusSign();
-        
+
+    }
+
+    /**
+     * Get all locales which <code>getInstance(Locale)</code> method support
+     * to return localize instance. The returned array locales include Java
+     * runtime and installed service provider supported locales. And it must
+     * contain <code>Locale</code> instance equals to <code>Locale.US</code>.
+     * 
+     * @return array of locales
+     */
+    public static Locale[] getAvailableLocales() {
+        throw new NotImplementedException();
+    }
+
+    /**
+     * Return the DecimalFormatSymbols instance for the default locale.
+     * 
+     * @return an instance of DecimalFormatSymbols
+     * 
+     * @since 1.6
+     */
+    public static final DecimalFormatSymbols getInstance() {
+        throw new NotImplementedException();
+    }
+
+    /**
+     * Return the DecimalFormatSymbols for the specified locale. This method
+     * return DecimalFormatSymbols instances for locales supported by the Java
+     * runtime and installed DecimalFormatSymbolsProvider implementations.
+     * 
+     * @param locale
+     *            locale for the returned DecimalFormatSymbols instance
+     * 
+     * @return an instance of DecimalFormatSymbols
+     * 
+     * @exception NullPointerException
+     *                if locale is null
+     * 
+     * @since 1.6
+     */
+    public static final DecimalFormatSymbols getInstance(Locale locale) {
+        throw new NotImplementedException();
     }
 
     /**
@@ -191,6 +236,15 @@
     }
 
     /**
+     * Answers the String which separate the mantissa from the exponent.
+     * 
+     * @return a String
+     */
+    public String getExponentSeparator() {
+        throw new NotImplementedException();
+    }
+
+    /**
      * Answers the character used as the thousands separator in a number.
      * 
      * @return a char
@@ -384,6 +438,16 @@
     }
 
     /**
+     * Set the String which separate the mantissa from the exponent
+     * 
+     * @param value
+     *            the exponent separator String
+     */
+    public void setExponentSeparator(String value) {
+        throw new NotImplementedException();
+    }
+
+    /**
      * Sets the character used as the thousands separator in a number.
      * 
      * @param value
@@ -549,8 +613,8 @@
             currency = null;
         }
     }
-    
-    Locale getLocale(){
+
+    Locale getLocale() {
         return locale;
     }
 }

Added: 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=648126&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
Mon Apr 14 23:28:39 2008
@@ -0,0 +1,44 @@
+/* 
+ * 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 provider which provide
+ * instances of <code>DateFormatSymbols</code> class.
+ * 
+ */
+public abstract class DateFormatSymbolsProvider extends LocaleServiceProvider {
+
+    protected DateFormatSymbolsProvider() {
+        super();
+    }
+
+    /**
+     * Get an instance of <code>DateFormatSymbols</code> with specified
+     * locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return a <code>DateFormatSymbols</code> instance
+     */
+    public abstract DateFormatSymbols getInstance(Locale locale);
+}

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

Added: 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=648126&view=auto
==============================================================================
--- 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/DecimalFormatSymbolsProvider.java
Mon Apr 14 23:28:39 2008
@@ -0,0 +1,45 @@
+/* 
+ * 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 provider which provide
+ * instances of <code>DecimalFormatSymbols</code> class.
+ */
+public abstract class DecimalFormatSymbolsProvider extends
+        LocaleServiceProvider {
+
+    protected DecimalFormatSymbolsProvider() {
+        super();
+    }
+
+    /**
+     * Get an instance of <code>DecimalFormatSymbols</code> with specified
+     * locale.
+     * 
+     * @param locale
+     *            the specified locale
+     * @return a <code>DecimalFormatSymbols</code> instance
+     */
+    public abstract DecimalFormatSymbols getInstance(Locale locale);
+
+}

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



Mime
View raw message