|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<SupportedTimeFormat>
pl.edu.agh.cast.data.model.common.SupportedTimeFormat
public enum SupportedTimeFormat
Defines time formats and provides basic methods for parsing and formating times.
Supported time formats:
For more details about defining time formats see SimpleDateFormat
Enum Constant Summary | |
---|---|
HH_MM_A_COLON
hh:mm a format, e.g. |
|
HH_MM_COLON
HH:mm format, e.g. |
|
HH_MM_SS_A_COLON
hh:mm:ss a format, e.g. |
|
HH_MM_SS_COLON
HH:mm:ss format, e.g. |
Method Summary | |
---|---|
String |
format(Date time)
Formats given time. |
static String |
formatDefault(Date time)
Formats time using the default format: HH:mm:ss. |
static String |
getDefaultFormat()
Returns the default time format. |
String |
getFormat()
Returns the time format. |
static Date |
parse(String text)
Parsed given text according to all supported formats. |
static SupportedTimeFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static SupportedTimeFormat[] |
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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final SupportedTimeFormat HH_MM_SS_COLON
public static final SupportedTimeFormat HH_MM_COLON
public static final SupportedTimeFormat HH_MM_SS_A_COLON
public static final SupportedTimeFormat HH_MM_A_COLON
Method Detail |
---|
public static SupportedTimeFormat[] values()
for (SupportedTimeFormat c : SupportedTimeFormat.values()) System.out.println(c);
public static SupportedTimeFormat valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static Date parse(String text) throws ParseException
text
- text to parse.
ParseException
- if text does not match to any format. exception generated by the last format is thrownpublic static String formatDefault(Date time)
time
- time to format
public String format(Date time)
time
- time to format
public String getFormat()
public static String getDefaultFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |