diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-08 22:21:50 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-08 22:21:50 +0000 |
commit | b4fe8cc4464910a7eac139ebd8c48e4d2bf40c00 (patch) | |
tree | 9c426e950b4514145123e218f2d88bb529e7d72f /libjava/java/text | |
parent | 0f59ea7de362473929d531e73a3f42c5868fe674 (diff) | |
download | gcc-b4fe8cc4464910a7eac139ebd8c48e4d2bf40c00.tar.gz |
* java/text/DateFormat.java (computeInstance): Separate time
and date styles.
(getDateTimeInstance): Ditto.
(getDateTimeInstance(int,int)): New method.
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Add new classes.
* java/util/PropertyResourceBundle.java: New file.
* gnu/gcj/util/EnumerationChain.java: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/text')
-rw-r--r-- | libjava/java/text/DateFormat.java | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/libjava/java/text/DateFormat.java b/libjava/java/text/DateFormat.java index bfd6b01a777..a84113368c3 100644 --- a/libjava/java/text/DateFormat.java +++ b/libjava/java/text/DateFormat.java @@ -94,6 +94,15 @@ public abstract class DateFormat extends Format implements Cloneable boolean use_date, boolean use_time) { + return computeInstance (style, style, loc, use_date, use_time); + } + + private static final DateFormat computeInstance (int dateStyle, + int timeStyle, + Locale loc, + boolean use_date, + boolean use_time) + { ResourceBundle res; try { @@ -108,7 +117,7 @@ public abstract class DateFormat extends Format implements Cloneable if (use_date) { String name, def; - switch (style) + switch (dateStyle) { case FULL: name = "fullDateFormat"; @@ -147,7 +156,7 @@ public abstract class DateFormat extends Format implements Cloneable pattern += " "; String name, def; - switch (style) + switch (timeStyle) { case FULL: name = "fullTimeFormat"; @@ -201,23 +210,31 @@ public abstract class DateFormat extends Format implements Cloneable public static final DateFormat getDateTimeInstance () { - return getDateTimeInstance (DEFAULT, Locale.getDefault()); + return getDateTimeInstance (DEFAULT, DEFAULT, Locale.getDefault()); } public static final DateFormat getDateTimeInstance (int style) { - return getDateTimeInstance (style, Locale.getDefault()); + return getDateTimeInstance (style, style, Locale.getDefault()); + } + + public static final DateFormat getDateTimeInstance (int dateStyle, + int timeStyle) + { + return getDateTimeInstance (dateStyle, timeStyle, Locale.getDefault()); } - public static final DateFormat getDateTimeInstance (int style, Locale loc) + public static final DateFormat getDateTimeInstance (int dateStyle, + int timeStyle, + Locale loc) { - return computeInstance (style, loc, true, true); + return computeInstance (dateStyle, timeStyle, loc, true, true); } public static final DateFormat getInstance () { // JCL book says SHORT. - return getDateTimeInstance (SHORT, Locale.getDefault()); + return getDateTimeInstance (SHORT, SHORT, Locale.getDefault()); } public NumberFormat getNumberFormat () |