Interface WallTime

All Known Implementing Classes:
PlainTime, PlainTimestamp

public interface WallTime

Defines a wall time on an analogue clock conforming to ISO-8601 in the range T00:00:00 - T24:00:00.

Note: Implementations must document if they support the special value T24:00:00 or not. This value denotes midnight at the end of the day, that is midnight T00:00 at the begin of the following day.

Author:
Meno Hochschild
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Yields the hour of day.
    int
    Yields the minute of hour.
    int
    Yields the nanosecond.
    int
    Yields the second of minute.
    Yields a canonical representation in ISO-format "Thh:mm" or "Thh:mm:ss".
  • Method Details

    • getHour

      int getHour()

      Yields the hour of day.

      Returns:
      hour in range 0 - 24 (the value 24 is only allowed if minute and second have the value 0)
    • getMinute

      int getMinute()

      Yields the minute of hour.

      Returns:
      minute in range 0 - 59
    • getSecond

      int getSecond()

      Yields the second of minute.

      Given this context and the fact that this interface describes an analogue clock without UTC reference, the special leapsecond value 60 cannot be supported.

      Returns:
      second in range 0 - 59
    • getNanosecond

      int getNanosecond()

      Yields the nanosecond.

      Implementations which are not capable of nanosecond precision will just yield 0 or another suitable rounded value.

      Returns:
      nanosecond in range 0 - 999,999,999
    • toString

      String toString()

      Yields a canonical representation in ISO-format "Thh:mm" or "Thh:mm:ss".

      If this object also knows subseconds then a fractional part of second part is possible.

      Overrides:
      toString in class Object
      Returns:
      wall time in ISO-8601 format