Package org.apache.calcite.util.format
Enum FormatElementEnum
- All Implemented Interfaces:
Serializable
,Comparable<FormatElementEnum>
,Constable
,FormatElement
Implementation of
FormatElement
containing the standard format
elements. These are based on Oracle's format model documentation.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the description of an element.void
Adds the appropriateSimpleDateFormat
pattern for the element to provided StringBuilder.static FormatElementEnum
Returns the enum constant of this type with the specified name.static FormatElementEnum[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.apache.calcite.util.format.FormatElement
flatten, format
-
Enum Constant Details
-
CC
-
D
-
DAY
-
Day
-
day
-
DD
-
DDD
-
DY
-
Dy
-
dy
-
E
-
FF1
-
FF2
-
FF3
-
FF4
-
FF5
-
FF6
-
FF7
-
FF8
-
FF9
-
HH12
-
HH24
-
ID
-
IW
-
IYY
-
IYYYY
-
MI
-
MM
-
MON
-
Mon
-
mon
-
MONTH
-
Month
-
month
-
PM
-
Q
-
AMPM
-
AM_PM
-
ampm
-
am_pm
-
MS
-
SS
-
SSSSS
-
TZR
-
W
-
WW
-
Y
-
YY
-
YYY
-
YYYY
-
pctY
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getDescription
Description copied from interface:FormatElement
Returns the description of an element.For example,
%H
in MySQL represents the hour in 24-hour format (e.g., 00..23). This method returns the string "The hour (24-hour clock) as a decimal number (00-23)", which is the description ofHH24
.- Specified by:
getDescription
in interfaceFormatElement
-
toPattern
Description copied from interface:FormatElement
Adds the appropriateSimpleDateFormat
pattern for the element to provided StringBuilder.Note that certain FormatElements may not have a Java equivalent. In such cases, calling this method will throw an
UnsupportedOperationException
. SeeQ
as an example.- Specified by:
toPattern
in interfaceFormatElement
-