diff options
author | Dalibor Topic <robilad@kaffe.org> | 2005-02-20 21:18:30 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-02-20 21:18:30 +0000 |
commit | 7d651220a36ec97dfbff7e6bd23fe6147956f078 (patch) | |
tree | 60fdf53adbc4000a2ef51e30a5f32ac9d42b11bf /libjava/java/text | |
parent | 237eaf79a5cb53340d8451e3379d6c483ec4f1aa (diff) | |
download | gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.zip gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.tar.gz gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.tar.bz2 |
RE.java, [...]: Made 'inner' classes real public static inner classes...
2005-02-20 Dalibor Topic <robilad@kaffe.org>
* libraries/javalib/gnu/regexp/RE.java,
libraries/javalib/java/io/ObjectInputStream.java,
libraries/javalib/java/security/AllPermission.java,
libraries/javalib/java/security/BasicPermission.java,
libraries/javalib/java/security/Permissions.java,
libraries/javalib/java/text/MessageFormat.java:
Made 'inner' classes real public static inner classes,
and made them final where possible, or removed them
where unused.
From-SVN: r95310
Diffstat (limited to 'libjava/java/text')
-rw-r--r-- | libjava/java/text/MessageFormat.java | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java index 6a031bc..6c1b050 100644 --- a/libjava/java/text/MessageFormat.java +++ b/libjava/java/text/MessageFormat.java @@ -46,107 +46,107 @@ import java.util.HashMap; import java.util.Locale; import java.util.Vector; -/** - * @author Tom Tromey <tromey@cygnus.com> - * @author Jorge Aliss <jaliss@hotmail.com> - * @date March 3, 1999 - */ -/* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 from http://www.javasoft.com. - * Status: Believed complete and correct to 1.2, except serialization. - * and parsing. - */ -final class MessageFormatElement +public class MessageFormat extends Format { - // Argument number. - int argNumber; - // Formatter to be used. This is the format set by setFormat. - Format setFormat; - // Formatter to be used based on the type. - Format format; - - // Argument will be checked to make sure it is an instance of this - // class. - Class formatClass; - - // Formatter type. - String type; - // Formatter style. - String style; - - // Text to follow this element. - String trailer; - - // Recompute the locale-based formatter. - void setLocale (Locale loc) + /** + * @author Tom Tromey (tromey@cygnus.com) + * @author Jorge Aliss (jaliss@hotmail.com) + * @date March 3, 1999 + */ + /* Written using "Java Class Libraries", 2nd edition, plus online + * API docs for JDK 1.2 from http://www.javasoft.com. + * Status: Believed complete and correct to 1.2, except serialization. + * and parsing. + */ + private static final class MessageFormatElement { - if (type == null) - ; - else if (type.equals("number")) - { - formatClass = java.lang.Number.class; - - if (style == null) - format = NumberFormat.getInstance(loc); - else if (style.equals("currency")) - format = NumberFormat.getCurrencyInstance(loc); - else if (style.equals("percent")) - format = NumberFormat.getPercentInstance(loc); - else if (style.equals("integer")) - { - NumberFormat nf = NumberFormat.getNumberInstance(loc); - nf.setMaximumFractionDigits(0); - nf.setGroupingUsed(false); - format = nf; - } - else - { - format = NumberFormat.getNumberInstance(loc); - DecimalFormat df = (DecimalFormat) format; - df.applyPattern(style); - } - } - else if (type.equals("time") || type.equals("date")) - { - formatClass = java.util.Date.class; - - int val = DateFormat.DEFAULT; - if (style == null) - ; - else if (style.equals("short")) - val = DateFormat.SHORT; - else if (style.equals("medium")) - val = DateFormat.MEDIUM; - else if (style.equals("long")) - val = DateFormat.LONG; - else if (style.equals("full")) - val = DateFormat.FULL; - - if (type.equals("time")) - format = DateFormat.getTimeInstance(val, loc); - else - format = DateFormat.getDateInstance(val, loc); - - if (style != null && val == DateFormat.DEFAULT) - { - SimpleDateFormat sdf = (SimpleDateFormat) format; - sdf.applyPattern(style); - } - } - else if (type.equals("choice")) - { - formatClass = java.lang.Number.class; - - if (style == null) - throw new - IllegalArgumentException ("style required for choice format"); - format = new ChoiceFormat (style); - } + // Argument number. + int argNumber; + // Formatter to be used. This is the format set by setFormat. + Format setFormat; + // Formatter to be used based on the type. + Format format; + + // Argument will be checked to make sure it is an instance of this + // class. + Class formatClass; + + // Formatter type. + String type; + // Formatter style. + String style; + + // Text to follow this element. + String trailer; + + // Recompute the locale-based formatter. + void setLocale (Locale loc) + { + if (type == null) + ; + else if (type.equals("number")) + { + formatClass = java.lang.Number.class; + + if (style == null) + format = NumberFormat.getInstance(loc); + else if (style.equals("currency")) + format = NumberFormat.getCurrencyInstance(loc); + else if (style.equals("percent")) + format = NumberFormat.getPercentInstance(loc); + else if (style.equals("integer")) + { + NumberFormat nf = NumberFormat.getNumberInstance(loc); + nf.setMaximumFractionDigits(0); + nf.setGroupingUsed(false); + format = nf; + } + else + { + format = NumberFormat.getNumberInstance(loc); + DecimalFormat df = (DecimalFormat) format; + df.applyPattern(style); + } + } + else if (type.equals("time") || type.equals("date")) + { + formatClass = java.util.Date.class; + + int val = DateFormat.DEFAULT; + if (style == null) + ; + else if (style.equals("short")) + val = DateFormat.SHORT; + else if (style.equals("medium")) + val = DateFormat.MEDIUM; + else if (style.equals("long")) + val = DateFormat.LONG; + else if (style.equals("full")) + val = DateFormat.FULL; + + if (type.equals("time")) + format = DateFormat.getTimeInstance(val, loc); + else + format = DateFormat.getDateInstance(val, loc); + + if (style != null && val == DateFormat.DEFAULT) + { + SimpleDateFormat sdf = (SimpleDateFormat) format; + sdf.applyPattern(style); + } + } + else if (type.equals("choice")) + { + formatClass = java.lang.Number.class; + + if (style == null) + throw new + IllegalArgumentException ("style required for choice format"); + format = new ChoiceFormat (style); + } + } } -} -public class MessageFormat extends Format -{ private static final long serialVersionUID = 6479157306784022952L; public static class Field extends Format.Field |