public enum PartOfDay extends java.lang.Enum<PartOfDay>
This enumerated type specifies the part of the day when something happened, with the possibilities being morning, afternoon, evening, or late night.
Enum Constant and Description |
---|
AFTERNOON |
EVENING |
LATE_NIGHT |
MORNING |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
The overridden
toString method gives the part of day in
"Title Case." |
static PartOfDay |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PartOfDay[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PartOfDay MORNING
public static final PartOfDay AFTERNOON
public static final PartOfDay EVENING
public static final PartOfDay LATE_NIGHT
public static PartOfDay[] values()
for (PartOfDay c : PartOfDay.values()) System.out.println(c);
public static PartOfDay valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
method gives the part of day in
"Title Case."toString
in class java.lang.Enum<PartOfDay>