Enum Class DataFormat
- All Implemented Interfaces:
Serializable, Comparable<DataFormat>, Constable
常用儲存格資料格式
每個列舉值對應一個 Excel 格式字串(非 Java 的 DateTimeFormatter 樣式)。
透過 Cell.setDataFormat(DataFormat) 套用,省去手寫 Excel 格式碼。
需要自訂格式時改用 Cell.setDataFormat(String) 直接傳入 Excel 格式字串。
- Since:
- 4.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionpattern()取得對應的 Excel 格式字串static DataFormatReturns the enum constant of this class with the specified name.static DataFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TEXT
一般文字(@) -
DATE
日期(yyyy-mm-dd) -
DATETIME
日期時間(yyyy-mm-dd hh:mm:ss) -
TIME
時間(hh:mm:ss) -
INTEGER
整數(千分位,#,##0) -
FLOAT
浮點數(千分位兩位小數,#,##0.00) -
MONEY
貨幣($#,##0.00) -
PERCENT
百分比(0.00%)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
pattern
-