Class EthiopianTime

All Implemented Interfaces:
Serializable, Comparable<EthiopianTime>, ChronoDisplay, Temporal<EthiopianTime>, LocalizedPatternSupport

@CalendarType("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.

Mapping table
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:

Standard scheme of day periods
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
  • Field Details

  • Method Details

    • ofDay

      public static EthiopianTime ofDay(int hour, int minute)

      Equivalent to ofDay(hour, minute, 0).

      Parameters:
      hour - ethiopian hour in range 1-12 during day
      minute - minute of hour
      Returns:
      ethiopian time
      Since:
      3.11/4.8
    • ofDay

      public 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).

      Parameters:
      hour - ethiopian hour in range 1-12 during day
      minute - minute of hour
      second - second of hour
      Returns:
      ethiopian time
      Since:
      3.11/4.8
      See Also:
      ofNight(int, int, int)
    • ofNight

      public static EthiopianTime ofNight(int hour, int minute)

      Equivalent to ofNight(hour, minute, 0).

      Parameters:
      hour - ethiopian hour in range 1-12 during night
      minute - minute of hour
      Returns:
      ethiopian time
      Since:
      3.11/4.8
    • ofNight

      public 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).

      Parameters:
      hour - ethiopian hour in range 1-12 during night
      minute - minute of hour
      second - second of hour
      Returns:
      ethiopian time
      Since:
      3.11/4.8
      See Also:
      ofDay(int, int, int)
    • nowInSystemTime

      public static EthiopianTime 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.

      Returns:
      hour in range 1-12
      Since:
      3.11/4.8
      See Also:
      isDay(), isNight()
    • 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

      public boolean isAfter(EthiopianTime other)
      Description copied from interface: Temporal

      Queries if this object is after given object on a timeline.

      Specified by:
      isAfter in interface Temporal<EthiopianTime>
      Parameters:
      other - object this instance is compared to
      Returns:
      true if this instance is temporally after temporal else false
    • isBefore

      public boolean isBefore(EthiopianTime other)
      Description copied from interface: Temporal

      Queries if this object is before given object on a timeline.

      Specified by:
      isBefore in interface Temporal<EthiopianTime>
      Parameters:
      other - object this instance is compared to
      Returns:
      true if this instance is temporally before temporal else false
    • isSimultaneous

      public boolean isSimultaneous(EthiopianTime other)
      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 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.

      Specified by:
      isSimultaneous in interface Temporal<EthiopianTime>
      Parameters:
      other - object this instance is compared to
      Returns:
      true if this instance is temporally equal to temporal else false
    • compareTo

      public int compareTo(EthiopianTime other)
      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 interface Comparable<EthiopianTime>
      Specified by:
      compareTo in class TimePoint<EthiopianTime.Unit,​EthiopianTime>
      See Also:
      TimePoint.equals(Object)
    • equals

      public boolean equals(Object obj)
      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 class TimePoint<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 class TimePoint<EthiopianTime.Unit,​EthiopianTime>
    • toString

      public String 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 class TimePoint<EthiopianTime.Unit,​EthiopianTime>
    • toISO

      public PlainTime toISO()

      Converts this instance to its ISO-analogy.

      Returns:
      PlainTime
      Since:
      3.11/4.8
    • from

      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.

      Parameters:
      time - ISO-time
      Returns:
      Ethiopian time
      Since:
      3.11/4.8
    • axis

      public static TimeAxis<EthiopianTime.Unit,​EthiopianTime> 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)