public enum Meridiem extends java.lang.Enum<Meridiem> implements ChronoCondition<WallTime>
Represents the half day relative to noon.
| Enum Constant and Description |
|---|
AM
Marks the wall time from midnight (at start of day) until
before noon (ante meridiem).
|
PM
Marks the wall time at or after noon (post meridiem).
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDisplayName(java.util.Locale locale)
Gets a descriptive text in given language.
|
static Meridiem |
ofHour(int hour)
Calculates the meridiem value dependent on given hour of day.
|
boolean |
test(WallTime context)
Decides if given context matches this condition.
|
static Meridiem |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Meridiem[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Meridiem AM
Marks the wall time from midnight (at start of day) until before noon (ante meridiem).
The numerical value is 0.
public static final Meridiem PM
Marks the wall time at or after noon (post meridiem).
The numerical value is 1.
public static Meridiem[] values()
for (Meridiem c : Meridiem.values()) System.out.println(c);
public static Meridiem 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 static Meridiem ofHour(int hour)
Calculates the meridiem value dependent on given hour of day.
hour - ISO-hour in the range 0 <= hour <= 24java.lang.IllegalArgumentException - if the hour is out of rangePlainTime.AM_PM_OF_DAYpublic java.lang.String getDisplayName(java.util.Locale locale)
Gets a descriptive text in given language.
locale - language of text to be printedpublic boolean test(WallTime context)
ChronoConditionDecides if given context matches this condition.
Due to better readability it is recommended to use following equivalent approach instead of this method::
import static net.time4j.Weekday.SATURDAY; import static net.time4j.Month.JANUARY; PlainDate date = PlainDate.of(2014, JANUARY, 25); System.out.println(SATURDAY.test(date)); // direct use System.out.println(date.matches(SATURDAY)); // recommended callback
test in interface ChronoCondition<WallTime>context - context as base of testing this conditiontrue if given time context matches this condition
else false