Class EthiopianTime
- All Implemented Interfaces:
Serializable
,Comparable<EthiopianTime>
,ChronoDisplay
,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:
- Since:
- 3.11/4.8
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Defines the time units for the Ethiopian clock time. -
Field Summary
Modifier and TypeFieldDescriptionstatic ChronoElement<Meridiem>
Behaves likePlainTime.AM_PM_OF_DAY
.static ChronoElement<Integer>
Behaves likePlainTime.DIGITAL_HOUR_OF_DAY
with the hour range 0-23.static ChronoElement<Integer>
The Ethiopian hour with the range 1-12 which is 6 hours behind the western clock.static ChronoElement<PlainTime>
Behaves likePlainTime.COMPONENT
and serves for conversion.static ChronoElement<Integer>
The minute of hour with the range 0-59.static ChronoElement<Integer>
The second of minute with the range 0-59. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Compares the whole state of this instance with given object.static EthiopianTime
Converts given ISO-time to Ethiopian time.int
getHour()
Yields the Ethiopian clock hour in range 1-12.int
Yields the minute of hour.int
Yields the second of minute.int
hashCode()
Subclasses must redefine this method corresponding to the behaviour ofequals()
.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
Obtains the current Ethiopian time in system time.static EthiopianTime
ofDay(int hour, int minute)
Equivalent toofDay(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 toofNight(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).toISO()
Converts this instance to its ISO-analogy.toString()
Provides a complete textual representation of the state of this time point.Methods inherited from class net.time4j.engine.TimePoint
max, min, minus, minus, plus, plus, until, until
Methods inherited from class net.time4j.engine.ChronoEntity
contains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, with
Methods inherited from interface net.time4j.format.LocalizedPatternSupport
getFormatPattern, getFormatPattern, useDynamicFormatPattern
Methods inherited from interface net.time4j.engine.Temporal
isAfterAll, isAfterOrEqual, isBeforeAll, isBeforeOrEqual
-
Field Details
-
ISO_TIME
Behaves likePlainTime.COMPONENT
and serves for conversion.- Since:
- 3.12/4.9
-
AM_PM_OF_DAY
Behaves likePlainTime.AM_PM_OF_DAY
. -
ETHIOPIAN_HOUR
The Ethiopian hour with the range 1-12 which is 6 hours behind the western clock. -
DIGITAL_HOUR_OF_DAY
Behaves likePlainTime.DIGITAL_HOUR_OF_DAY
with the hour range 0-23. -
MINUTE_OF_HOUR
The minute of hour with the range 0-59. -
SECOND_OF_MINUTE
The second of minute with the range 0-59.
-
-
Method Details
-
ofDay
Equivalent to
ofDay(hour, minute, 0)
.- Parameters:
hour
- ethiopian hour in range 1-12 during dayminute
- minute of hour- Returns:
- ethiopian time
- Since:
- 3.11/4.8
-
ofDay
Creates a new instance for times in the ISO-range (06:00:00-17:59:59).
- Parameters:
hour
- ethiopian hour in range 1-12 during dayminute
- minute of hoursecond
- second of hour- Returns:
- ethiopian time
- Since:
- 3.11/4.8
- See Also:
ofNight(int, int, int)
-
ofNight
Equivalent to
ofNight(hour, minute, 0)
.- Parameters:
hour
- ethiopian hour in range 1-12 during nightminute
- minute of hour- Returns:
- ethiopian time
- Since:
- 3.11/4.8
-
ofNight
Creates a new instance for times in the ISO-range (18:00:00-05:59:59 around midnight).
- Parameters:
hour
- ethiopian hour in range 1-12 during nightminute
- minute of hoursecond
- second of hour- Returns:
- ethiopian time
- Since:
- 3.11/4.8
- See Also:
ofDay(int, int, int)
-
nowInSystemTime
Obtains the current Ethiopian time in system time.
Convenient short-cut for:
EthiopianTime.from(PlainTime.nowInSystemTime())
.- Returns:
- current Ethiopian time in system time zone using the system clock
- Since:
- 3.32/4.27
- See Also:
SystemClock.inLocalView()
,ZonalClock.now(net.time4j.engine.Chronology)
-
isDay
public boolean isDay()Is this time during day (ISO 06:00:00-17:59:59)?
- Returns:
- boolean
- Since:
- 3.11/4.8
-
isNight
public boolean isNight()Is this time during night (ISO 18:00:00-05:59:59)?
- Returns:
- boolean
- Since:
- 3.11/4.8
-
getHour
public int getHour()Yields the Ethiopian clock hour in range 1-12.
-
getMinute
public int getMinute()Yields the minute of hour.
- Returns:
- int in range 0-59
- Since:
- 3.11/4.8
-
getSecond
public int getSecond()Yields the second of minute.
- Returns:
- int in range 0-59
- Since:
- 3.11/4.8
-
isAfter
Description copied from interface:Temporal
Queries if this object is after given object on a timeline.
- Specified by:
isAfter
in interfaceTemporal<EthiopianTime>
- Parameters:
other
- object this instance is compared to- Returns:
true
if this instance is temporally aftertemporal
elsefalse
-
isBefore
Description copied from interface:Temporal
Queries if this object is before given object on a timeline.
- Specified by:
isBefore
in interfaceTemporal<EthiopianTime>
- Parameters:
other
- object this instance is compared to- Returns:
true
if this instance is temporally beforetemporal
elsefalse
-
isSimultaneous
Description copied from interface:Temporal
Queries 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 theObject
-methodequals()
such that first the comparison type must be a temporal one and second that only temporal-only state will be considered.- Specified by:
isSimultaneous
in interfaceTemporal<EthiopianTime>
- Parameters:
other
- object this instance is compared to- Returns:
true
if this instance is temporally equal totemporal
elsefalse
-
compareTo
Description copied from class:TimePoint
Compares 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.- Specified by:
compareTo
in interfaceComparable<EthiopianTime>
- Specified by:
compareTo
in classTimePoint<EthiopianTime.Unit,EthiopianTime>
- See Also:
TimePoint.equals(Object)
-
equals
Description copied from class:TimePoint
Compares 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.
- Specified by:
equals
in classTimePoint<EthiopianTime.Unit,EthiopianTime>
- See Also:
TimePoint.compareTo(TimePoint)
-
hashCode
public int hashCode()Description copied from class:TimePoint
Subclasses must redefine this method corresponding to the behaviour of
equals()
.- Specified by:
hashCode
in classTimePoint<EthiopianTime.Unit,EthiopianTime>
-
toString
Description copied from class:TimePoint
Provides 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).
- Specified by:
toString
in classTimePoint<EthiopianTime.Unit,EthiopianTime>
-
toISO
Converts this instance to its ISO-analogy.
- Returns:
- PlainTime
- Since:
- 3.11/4.8
-
from
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.
- Parameters:
time
- ISO-time- Returns:
- Ethiopian time
- Since:
- 3.11/4.8
-
axis
Provides a static access to the associated time axis respective chronology which contains the chronological rules.
- Returns:
- chronological system as time axis (never
null
)
-