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

Diff of /classpath/java/text/SimpleDateFormat.java

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

revision 1.31 by gnu_andrew, Thu Jan 13 21:17:52 2005 UTC revision 1.32 by gnu_andrew, Sun Jan 16 01:02:58 2005 UTC
# Line 341  public class SimpleDateFormat extends Da Line 341  public class SimpleDateFormat extends Da
341    }    }
342    
343    /**    /**
344     * This method returns the format symbol information used for parsing     * This method returns a copy of the format symbol information used
345     * and formatting dates.     * for parsing and formatting dates.
346     *     *
347     * @return The date format symbols.     * @return a copy of the date format symbols.
348     */     */
349    public DateFormatSymbols getDateFormatSymbols()    public DateFormatSymbols getDateFormatSymbols()
350    {    {
351      return formatData;      return (DateFormatSymbols) formatData.clone();
352    }    }
353    
354    /**    /**
# Line 356  public class SimpleDateFormat extends Da Line 356  public class SimpleDateFormat extends Da
356     * and formatting dates.     * and formatting dates.
357     *     *
358     * @param formatData The date format symbols.     * @param formatData The date format symbols.
359       * @throws NullPointerException if <code>formatData</code> is null.
360     */     */
361     public void setDateFormatSymbols(DateFormatSymbols formatData)     public void setDateFormatSymbols(DateFormatSymbols formatData)
362     {     {
363         if (formatData == null)
364           {
365             throw new
366               NullPointerException("The supplied format data was null.");
367           }
368       this.formatData = formatData;       this.formatData = formatData;
369     }     }
370    
# Line 866  public class SimpleDateFormat extends Da Line 872  public class SimpleDateFormat extends Da
872      calendar.set(Calendar.YEAR, year - 80);      calendar.set(Calendar.YEAR, year - 80);
873      set2DigitYearStart(calendar.getTime());      set2DigitYearStart(calendar.getTime());
874    }    }
875    
876      /**
877       * Returns a copy of this instance of
878       * <code>SimpleDateFormat</code>.  The copy contains
879       * clones of the formatting symbols and the 2-digit
880       * year century start date.
881       */
882      public Object clone()
883      {
884        SimpleDateFormat clone = (SimpleDateFormat) super.clone();
885        clone.setDateFormatSymbols((DateFormatSymbols) formatData.clone());
886        clone.set2DigitYearStart((Date) defaultCenturyStart.clone());
887        return clone;
888      }
889    
890  }  }

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

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