@CalendarType(value="ethiopic") public final class EthiopianTime extends TimePoint<EthiopianTime.Unit,EthiopianTime> implements Temporal<EthiopianTime>, LocalizedPatternSupport
Represents the 12-hour-time in second precision used in Ethiopia starting in the morning at 6 AM as zero point.
| ISO-8601 | Ethiopic |
|---|---|
| 00:00 | 6 (night) |
| 01:00 | 7 (night) |
| 02:00 | 8 (night) |
| 03:00 | 9 (night) |
| 04:00 | 10 (night) |
| 05:00 | 11 (night) |
| 06:00 | 12 (day) |
| 07:00 | 1 (day) |
| 08:00 | 2 (day) |
| 09:00 | 3 (day) |
| 10:00 | 4 (day) |
| 11:00 | 5 (day) |
| 12:00 | 6 (day) |
| 13:00 | 7 (day) |
| 14:00 | 8 (day) |
| 15:00 | 9 (day) |
| 16:00 | 10 (day) |
| 17:00 | 11 (day) |
| 18:00 | 12 (night) |
| 19:00 | 1 (night) |
| 20:00 | 2 (night) |
| 21:00 | 3 (night) |
| 22:00 | 4 (night) |
| 23:00 | 5 (night) |
This class applies following calendar specific day period scheme by default:
| Interval (ISO-8601) | Day period (transscription) |
|---|---|
| 23:00-00:59 | Ekul Leilit |
| 01:00-03:59 | Wedek'et |
| 04:00-05:59 | Nigat |
| 06:00-08:59 | T'uwat |
| 09:00-11:59 | Refad |
| 12:00-12:59 | Ekul K'en |
| 13:00-15:59 | Kese'at Behwala |
| 16:00-17:59 | Wedemata |
| 18:00-19:59 | Sidenegiz |
| 20:00-22:59 | Mishet |
Following elements which are declared as constants are registered by this class:
| Modifier and Type | Class and Description |
|---|---|
static class |
EthiopianTime.Unit
Defines the time units for the Ethiopian clock time.
|
| Modifier and Type | Field and Description |
|---|---|
static ChronoElement<Meridiem> |
AM_PM_OF_DAY
Behaves like
PlainTime.AM_PM_OF_DAY. |
static ChronoElement<Integer> |
DIGITAL_HOUR_OF_DAY
Behaves like
PlainTime.DIGITAL_HOUR_OF_DAY with the hour range 0-23. |
static ChronoElement<Integer> |
ETHIOPIAN_HOUR
The Ethiopian hour with the range 1-12 which is 6 hours behind the western clock.
|
static ChronoElement<PlainTime> |
ISO_TIME
Behaves like
PlainTime.COMPONENT and serves for conversion. |
static ChronoElement<Integer> |
MINUTE_OF_HOUR
The minute of hour with the range 0-59.
|
static ChronoElement<Integer> |
SECOND_OF_MINUTE
The second of minute with the range 0-59.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeAxis<EthiopianTime.Unit,EthiopianTime> |
axis()
Provides a static access to the associated time axis respective
chronology which contains the chronological rules.
|
int |
compareTo(EthiopianTime other)
Compares two time points preferably by their temporal positions
on the common time axis.
|
boolean |
equals(Object obj)
Compares the whole state of this instance with given object.
|
static EthiopianTime |
from(PlainTime time)
Converts given ISO-time to Ethiopian time.
|
int |
getHour()
Yields the Ethiopian clock hour in range 1-12.
|
int |
getMinute()
Yields the minute of hour.
|
int |
getSecond()
Yields the second of minute.
|
int |
hashCode()
Subclasses must redefine this method corresponding to the
behaviour of
equals(). |
boolean |
isAfter(EthiopianTime other)
Queries if this object is after given object on a timeline.
|
boolean |
isBefore(EthiopianTime other)
Queries if this object is before given object on a timeline.
|
boolean |
isDay()
Is this time during day (ISO 06:00:00-17:59:59)?
|
boolean |
isNight()
Is this time during night (ISO 18:00:00-05:59:59)?
|
boolean |
isSimultaneous(EthiopianTime other)
Queries if this object and given object have the same position
on the time axis.
|
static EthiopianTime |
nowInSystemTime()
Obtains the current Ethiopian time in system time.
|
static EthiopianTime |
ofDay(int hour,
int minute)
Equivalent to
ofDay(hour, minute, 0). |
static EthiopianTime |
ofDay(int hour,
int minute,
int second)
Creates a new instance for times in the ISO-range (06:00:00-17:59:59).
|
static EthiopianTime |
ofNight(int hour,
int minute)
Equivalent to
ofNight(hour, minute, 0). |
static EthiopianTime |
ofNight(int hour,
int minute,
int second)
Creates a new instance for times in the ISO-range (18:00:00-05:59:59 around midnight).
|
PlainTime |
toISO()
Converts this instance to its ISO-analogy.
|
String |
toString()
Provides a complete textual representation of the state of
this time point.
|
max, min, minus, minus, plus, plus, until, untilcontains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, withisAfterAll, isAfterOrEqual, isBeforeAll, isBeforeOrEqualgetFormatPattern, getFormatPattern, useDynamicFormatPatternpublic static final ChronoElement<PlainTime> ISO_TIME
PlainTime.COMPONENT and serves for conversion.@FormattableElement(format="a") public static final ChronoElement<Meridiem> AM_PM_OF_DAY
PlainTime.AM_PM_OF_DAY.@FormattableElement(format="h") public static final ChronoElement<Integer> ETHIOPIAN_HOUR
@FormattableElement(format="H") public static final ChronoElement<Integer> DIGITAL_HOUR_OF_DAY
PlainTime.DIGITAL_HOUR_OF_DAY with the hour range 0-23.@FormattableElement(format="m") public static final ChronoElement<Integer> MINUTE_OF_HOUR
@FormattableElement(format="s") public static final ChronoElement<Integer> SECOND_OF_MINUTE
public static EthiopianTime ofDay(int hour, int minute)
Equivalent to ofDay(hour, minute, 0).
hour - ethiopian hour in range 1-12 during dayminute - minute of hourpublic static EthiopianTime ofDay(int hour, int minute, int second)
Creates a new instance for times in the ISO-range (06:00:00-17:59:59).
hour - ethiopian hour in range 1-12 during dayminute - minute of hoursecond - second of hourofNight(int, int, int)public static EthiopianTime ofNight(int hour, int minute)
Equivalent to ofNight(hour, minute, 0).
hour - ethiopian hour in range 1-12 during nightminute - minute of hourpublic static EthiopianTime ofNight(int hour, int minute, int second)
Creates a new instance for times in the ISO-range (18:00:00-05:59:59 around midnight).
hour - ethiopian hour in range 1-12 during nightminute - minute of hoursecond - second of hourofDay(int, int, int)public static EthiopianTime nowInSystemTime()
Obtains the current Ethiopian time in system time.
Convenient short-cut for: EthiopianTime.from(PlainTime.nowInSystemTime()).
SystemClock.inLocalView(),
ZonalClock.now(net.time4j.engine.Chronology)public boolean isDay()
Is this time during day (ISO 06:00:00-17:59:59)?
public boolean isNight()
Is this time during night (ISO 18:00:00-05:59:59)?
public int getHour()
Yields the Ethiopian clock hour in range 1-12.
public int getMinute()
Yields the minute of hour.
public int getSecond()
Yields the second of minute.
public boolean isAfter(EthiopianTime other)
TemporalQueries if this object is after given object on a timeline.
isAfter in interface Temporal<EthiopianTime>other - object this instance is compared totrue if this instance is temporally after
temporal else falsepublic boolean isBefore(EthiopianTime other)
TemporalQueries if this object is before given object on a timeline.
isBefore in interface Temporal<EthiopianTime>other - object this instance is compared totrue if this instance is temporally before
temporal else falsepublic boolean isSimultaneous(EthiopianTime other)
TemporalQueries if this object and given object have the same position on the time axis.
Is equivalent to !isAfter(temporal) && !isBefore(temporal).
This method differs from the Object-method equals()
such that first the comparison type must be a temporal one and second
that only temporal-only state will be considered.
isSimultaneous in interface Temporal<EthiopianTime>other - object this instance is compared totrue if this instance is temporally equal
to temporal else falsepublic int compareTo(EthiopianTime other)
TimePointCompares two time points preferably by their temporal positions on the common time axis.
Implementation note: In order to make the natural order consistent
with equals() the whole state must be taken into account,
with preference for those attributes which define the temporal
position on the time axis.
compareTo in interface Comparable<EthiopianTime>compareTo in class TimePoint<EthiopianTime.Unit,EthiopianTime>TimePoint.equals(Object)public boolean equals(Object obj)
TimePointCompares the whole state of this instance with given object.
Implementations will usually define their state only based on the temporal position on the time axis because this is the most intuitive approach. Exceptions from this rule should be explicitly documented and reasoned.
equals in class TimePoint<EthiopianTime.Unit,EthiopianTime>TimePoint.compareTo(TimePoint)public int hashCode()
TimePointSubclasses must redefine this method corresponding to the
behaviour of equals().
hashCode in class TimePoint<EthiopianTime.Unit,EthiopianTime>public String toString()
TimePointProvides a complete textual representation of the state of this time point.
The textual description often follows the conventions of ISO-8601. Usually the description starts with the chronological informations which are coarse-grained and ends with those ones which are fine-grained (for example the ISO-notation YYYY-MM-DD).
toString in class TimePoint<EthiopianTime.Unit,EthiopianTime>public PlainTime toISO()
Converts this instance to its ISO-analogy.
public static EthiopianTime from(PlainTime time)
Converts given ISO-time to Ethiopian time.
The special time 24:00 will be treated like 00:00. Fractions of second are lost during conversion.
time - ISO-timepublic static TimeAxis<EthiopianTime.Unit,EthiopianTime> axis()
Provides a static access to the associated time axis respective chronology which contains the chronological rules.
null)Copyright © 2014–2021. All rights reserved.