public class FastDatePrinter extends AbstractDateBasic implements DatePrinter
FastDateParser,
Serialized Formlocale, pattern, timeZone| Constructor and Description |
|---|
FastDatePrinter(String pattern,
TimeZone timeZone,
Locale locale)
构造,内部使用
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(Calendar calendar)
Formats a
Calendar object. |
<B extends Appendable> |
format(Calendar calendar,
B buf)
Formats a
Calendar object into the supplied Appendable. |
String |
format(Date date)
使用
GregorianCalendar 格式化 Date |
<B extends Appendable> |
format(Date date,
B buf)
Formats a
Date object into the supplied Appendable using a GregorianCalendar. |
String |
format(long millis)
格式化日期表示的毫秒数
|
<B extends Appendable> |
format(long millis,
B buf)
Formats a millisecond
long value into the supplied Appendable. |
int |
getMaxLengthEstimate()
估算生成的日期字符串长度
实际生成的字符串长度小于或等于此值 |
protected List<cn.hutool.core.date.format.FastDatePrinter.Rule> |
parsePattern()
Returns a list of Rules given a pattern.
|
protected String |
parseToken(String pattern,
int[] indexRef)
Performs the parsing of tokens.
|
protected cn.hutool.core.date.format.FastDatePrinter.NumberRule |
selectNumberRule(int field,
int padding)
Gets an appropriate rule for the padding required.
|
equals, getLocale, getPattern, getTimeZone, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetLocale, getPattern, getTimeZoneprotected List<cn.hutool.core.date.format.FastDatePrinter.Rule> parsePattern()
Returns a list of Rules given a pattern.
List of Rule objectsIllegalArgumentException - if pattern is invalidprotected String parseToken(String pattern, int[] indexRef)
Performs the parsing of tokens.
pattern - the patternindexRef - index referencesprotected cn.hutool.core.date.format.FastDatePrinter.NumberRule selectNumberRule(int field,
int padding)
Gets an appropriate rule for the padding required.
field - the field to get a rule forpadding - the padding requiredpublic String format(long millis)
DatePrinterformat in interface DatePrintermillis - 日期毫秒数public String format(Date date)
DatePrinterGregorianCalendar 格式化 Dateformat in interface DatePrinterdate - 日期 Datepublic String format(Calendar calendar)
DatePrinter
Formats a Calendar object.
Calendarformat in interface DatePrintercalendar - Calendarpublic <B extends Appendable> B format(long millis, B buf)
DatePrinter
Formats a millisecond long value into the supplied Appendable.
format in interface DatePrinterB - the Appendable class type, usually StringBuilder or StringBuffer.millis - the millisecond value to formatbuf - the buffer to format intopublic <B extends Appendable> B format(Date date, B buf)
DatePrinter
Formats a Date object into the supplied Appendable using a GregorianCalendar.
format in interface DatePrinterB - the Appendable class type, usually StringBuilder or StringBuffer.date - the date to formatbuf - the buffer to format intopublic <B extends Appendable> B format(Calendar calendar, B buf)
DatePrinter
Formats a Calendar object into the supplied Appendable.
format in interface DatePrinterB - the Appendable class type, usually StringBuilder or StringBuffer.calendar - the calendar to formatbuf - the buffer to format intopublic int getMaxLengthEstimate()
Copyright © 2025. All rights reserved.