java.text.SimpleDateFormat.initializeCalendar(Locale)
/** * Constructs a <code>SimpleDateFormat</code> using the given pattern and * date format symbols. * * @param pattern the pattern describing the date and time format * @param formatSymbols the date format symbols to be used for formatting * @exception NullPointerException if the given pattern or formatSymbols is null * @exception IllegalArgumentException if the given pattern is invalid */ public SimpleDateFormat(String pattern, DateFormatSymbols formatSymbols) { if (pattern == null || formatSymbols == null) { throw new NullPointerException(); } this.pattern = pattern; this.formatData = (DateFormatSymbols) formatSymbols.clone(); this.locale = Locale.getDefault(Locale.Category.FORMAT); initializeCalendar(this.locale); initialize(this.locale); useDateFormatSymbols = true; }
/** * Constructs a <code>SimpleDateFormat</code> using the given pattern and * date format symbols. * * @param pattern the pattern describing the date and time format * @param formatSymbols the date format symbols to be used for formatting * @exception NullPointerException if the given pattern or formatSymbols is null * @exception IllegalArgumentException if the given pattern is invalid */ public SimpleDateFormat(String pattern, DateFormatSymbols formatSymbols) { if (pattern == null || formatSymbols == null) { throw new NullPointerException(); } this.pattern = pattern; this.formatData = (DateFormatSymbols) formatSymbols.clone(); this.locale = Locale.getDefault(Locale.Category.FORMAT); initializeCalendar(this.locale); initialize(this.locale); useDateFormatSymbols = true; }
/** * Constructs a <code>SimpleDateFormat</code> using the given pattern and * the default date format symbols for the given locale. * <b>Note:</b> This constructor may not support all locales. * For full coverage, use the factory methods in the {@link DateFormat} * class. * * @param pattern the pattern describing the date and time format * @param locale the locale whose date format symbols should be used * @exception NullPointerException if the given pattern or locale is null * @exception IllegalArgumentException if the given pattern is invalid */ public SimpleDateFormat(String pattern, Locale locale) { if (pattern == null || locale == null) { throw new NullPointerException(); } initializeCalendar(locale); this.pattern = pattern; this.formatData = DateFormatSymbols.getInstanceRef(locale); this.locale = locale; initialize(locale); }
/** * Constructs a <code>SimpleDateFormat</code> using the given pattern and * the default date format symbols for the given locale. * <b>Note:</b> This constructor may not support all locales. * For full coverage, use the factory methods in the {@link DateFormat} * class. * * @param pattern the pattern describing the date and time format * @param locale the locale whose date format symbols should be used * @exception NullPointerException if the given pattern or locale is null * @exception IllegalArgumentException if the given pattern is invalid */ public SimpleDateFormat(String pattern, Locale locale) { if (pattern == null || locale == null) { throw new NullPointerException(); } initializeCalendar(locale); this.pattern = pattern; this.formatData = DateFormatSymbols.getInstanceRef(locale); this.locale = locale; initialize(locale); }