/[classpath]/classpath/java/text/DecimalFormat.java
ViewVC logotype

Diff of /classpath/java/text/DecimalFormat.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by glavaux, Thu May 20 10:34:33 2004 UTC revision 1.17 by mkoch, Fri Oct 22 17:15:57 2004 UTC
# Line 1  Line 1 
1  /* DecimalFormat.java -- Formats and parses numbers  /* DecimalFormat.java -- Formats and parses numbers
2     Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.     Copyright (C) 1999, 2000, 2001, 2003, 2004  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 62  public class DecimalFormat extends Numbe Line 62  public class DecimalFormat extends Numbe
62  {  {
63    // This is a helper for applyPatternWithSymbols.  It reads a prefix    // This is a helper for applyPatternWithSymbols.  It reads a prefix
64    // or a suffix.  It can cause some side-effects.    // or a suffix.  It can cause some side-effects.
65    private final int scanFix (String pattern, int index, FormatBuffer buf,    private int scanFix (String pattern, int index, FormatBuffer buf,
66                               String patChars, DecimalFormatSymbols syms,                         String patChars, DecimalFormatSymbols syms,
67                               boolean is_suffix)                         boolean is_suffix)
68    {    {
69      int len = pattern.length();      int len = pattern.length();
70      boolean quoteStarted = false;      boolean quoteStarted = false;
# Line 140  public class DecimalFormat extends Numbe Line 140  public class DecimalFormat extends Numbe
140    }    }
141    
142    // A helper which reads a number format.    // A helper which reads a number format.
143    private final int scanFormat (String pattern, int index,    private int scanFormat (String pattern, int index, String patChars,
144                                  String patChars, DecimalFormatSymbols syms,                            DecimalFormatSymbols syms, boolean is_positive)
                                 boolean is_positive)  
145    {    {
146      int max = pattern.length();      int max = pattern.length();
147    
# Line 294  public class DecimalFormat extends Numbe Line 293  public class DecimalFormat extends Numbe
293    
294    // This helper function creates a string consisting of all the    // This helper function creates a string consisting of all the
295    // characters which can appear in a pattern and must be quoted.    // characters which can appear in a pattern and must be quoted.
296    private final String patternChars (DecimalFormatSymbols syms)    private String patternChars (DecimalFormatSymbols syms)
297    {    {
298      StringBuffer buf = new StringBuffer ();      StringBuffer buf = new StringBuffer ();
299      buf.append(syms.getDecimalSeparator());      buf.append(syms.getDecimalSeparator());
# Line 313  public class DecimalFormat extends Numbe Line 312  public class DecimalFormat extends Numbe
312      return buf.toString();      return buf.toString();
313    }    }
314    
315    private final void applyPatternWithSymbols (String pattern,    private void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms)
                                               DecimalFormatSymbols syms)  
316    {    {
317      // Initialize to the state the parser expects.      // Initialize to the state the parser expects.
318      negativePrefix = "";      negativePrefix = "";
# Line 425  public class DecimalFormat extends Numbe Line 423  public class DecimalFormat extends Numbe
423      applyPattern (pattern);      applyPattern (pattern);
424    }    }
425    
426    private final boolean equals (String s1, String s2)    private boolean equals(String s1, String s2)
427    {    {
428      if (s1 == null || s2 == null)      if (s1 == null || s2 == null)
429        return s1 == s2;        return s1 == s2;
# Line 1149  public class DecimalFormat extends Numbe Line 1147  public class DecimalFormat extends Numbe
1147      positiveSuffix = newValue;      positiveSuffix = newValue;
1148    }    }
1149    
1150    private final void quoteFix (StringBuffer buf, String text, String patChars)    private void quoteFix(StringBuffer buf, String text, String patChars)
1151    {    {
1152      int len = text.length();      int len = text.length();
1153      for (int index = 0; index < len; ++index)      for (int index = 0; index < len; ++index)
# Line 1166  public class DecimalFormat extends Numbe Line 1164  public class DecimalFormat extends Numbe
1164        }        }
1165    }    }
1166    
1167    private final String computePattern (DecimalFormatSymbols syms)    private String computePattern(DecimalFormatSymbols syms)
1168    {    {
1169      StringBuffer mainPattern = new StringBuffer ();      StringBuffer mainPattern = new StringBuffer ();
1170      // We have to at least emit a zero for the minimum number of      // We have to at least emit a zero for the minimum number of

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26