/** * Performs the formatting by applying the rules to the * specified calendar. * * @param calendar the calendar to format * @param buf the buffer to format into * @return the specified string buffer * * @deprecated use {@link #format(Calendar)} or {@link #format(Calendar, Appendable)} */ @Deprecated protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { return (StringBuffer) applyRules(calendar, (Appendable)buf); }
/** * <p>Performs the formatting by applying the rules to the * specified calendar.</p> * * @param calendar the calendar to format * @param buf the buffer to format into * @return the specified string buffer * @deprecated Use {@link #format(Calendar, Appendable)} */ @Deprecated protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { return printer.applyRules(calendar, buf); } }
/** * Creates a String representation of the given Calendar by applying the rules of this printer to it. * @param c the Calender to apply the rules to. * @return a String representation of the given Calendar. */ private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuilder(mMaxLengthEstimate)).toString(); }
@Override public <B extends Appendable> B format(Calendar calendar, final B buf) { // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored if(!calendar.getTimeZone().equals(mTimeZone)) { calendar = (Calendar)calendar.clone(); calendar.setTimeZone(mTimeZone); } return applyRules(calendar, buf); }
@Override public StringBuffer format(final long millis, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return (StringBuffer) applyRules(c, (Appendable)buf); }
@Override public StringBuffer format(final Date date, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTime(date); return (StringBuffer) applyRules(c, (Appendable)buf); }
@Override public <B extends Appendable> B format(final Date date, final B buf) { final Calendar c = newCalendar(); c.setTime(date); return applyRules(c, buf); }
@Override public <B extends Appendable> B format(final long millis, final B buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return applyRules(c, buf); }
/** * Creates a String representation of the given Calendar by applying the rules of this printer to it. * @param c the Calender to apply the rules to. * @return a String representation of the given Calendar. */ private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuilder(mMaxLengthEstimate)).toString(); }
/** * Creates a String representation of the given Calendar by applying the rules of this printer to it. * @param c the Calender to apply the rules to. * @return a String representation of the given Calendar. */ private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuilder(mMaxLengthEstimate)).toString(); }
@Override public <B extends Appendable> B format(Calendar calendar, final B buf) { // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored if(!calendar.getTimeZone().equals(mTimeZone)) { calendar = (Calendar)calendar.clone(); calendar.setTimeZone(mTimeZone); } return applyRules(calendar, buf); }
@Override public <B extends Appendable> B format(Calendar calendar, final B buf) { // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored if(!calendar.getTimeZone().equals(mTimeZone)) { calendar = (Calendar)calendar.clone(); calendar.setTimeZone(mTimeZone); } return applyRules(calendar, buf); }
@Override public StringBuffer format(final long millis, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return (StringBuffer) applyRules(c, (Appendable)buf); }
@Override public <B extends Appendable> B format(final Date date, final B buf) { final Calendar c = newCalendar(); c.setTime(date); return applyRules(c, buf); }
@Override public StringBuffer format(final Date date, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTime(date); return (StringBuffer) applyRules(c, (Appendable)buf); }
@Override public <B extends Appendable> B format(final Date date, final B buf) { final Calendar c = newCalendar(); c.setTime(date); return applyRules(c, buf); }
@Override public StringBuffer format(final long millis, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return (StringBuffer) applyRules(c, (Appendable)buf); }
@Override public <B extends Appendable> B format(final long millis, final B buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return applyRules(c, buf); }
@Override public <B extends Appendable> B format(final Date date, final B buf) { final Calendar c = newCalendar(); c.setTime(date); return applyRules(c, buf); }
@Override public StringBuffer format(final Date date, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTime(date); return (StringBuffer) applyRules(c, (Appendable)buf); }