org.enblom.time
Interface TimeOfDayFormatter


public interface TimeOfDayFormatter

Provides methods for formatting a TimeOfDay object as a human-readable string.

The following notation will be used:

hh:The hour of the time written with two digits. A 24-hour scale is used, so this will be in the range 00-23.
mm:The minute of the time written with two digits; in the range 00-59.
ss:The second of the time written with two digits; in the range 00-59.
nnn:The millisecond of the time written with three digits; in the range 000-999.

There are three standard formatters: ISO, EUR and US, provided by Time.iso(), Time.eur() and Time.us(), respectively. The ISO formatter formats timestamps according to the ISO-8601 standard, the EUR formatter formats timestamps according to some de-facto European standard, and the US formatter formats timestamps according to US standards. In the case of formatting a time of day, all these formatters coincide, but they are still separated to follow the pattern of TimeFormatter and DayDateFormatter.

Author:
Andreas Enblom

Method Summary
 String formatCompactLongTime()
          Formats the time of day as a compact string, with no delimiters between the different parts of the time.
 String formatCompactShortTime()
          Formats the time of day as a compact string, with no delimiters between the different parts of the time.
 String formatCompactTime()
          Formats the time of day as a compact string, with no delimiters between the different parts of the time.
 String formatLongTime()
          Formats the time of day as a string, with delimiters between the different parts of this time.
 String formatShortTime()
          Formats the time of day as a string, with delimiters between the different parts of this time.
 String formatTime()
          Formats the time of day as a string, with delimiters between the different parts of this time.
 

Method Detail

formatCompactTime

String formatCompactTime()
Formats the time of day as a compact string, with no delimiters between the different parts of the time. The formatting will include hour, minute and second.
FormatterFormat
ISOhhmmss
EURhhmmss
UShhmmss

Returns:
The time of day, formatted as a string.

formatCompactLongTime

String formatCompactLongTime()
Formats the time of day as a compact string, with no delimiters between the different parts of the time. The formatting will include hour, minute, second and millisecond.
FormatterFormat
ISOhhmmssnnn
EURhhmmssnnn
UShhmmssnnn

Returns:
The time of day, formatted as a string.

formatCompactShortTime

String formatCompactShortTime()
Formats the time of day as a compact string, with no delimiters between the different parts of the time. The formatting will include hour and minute.
FormatterFormat
ISOhhmm
EURhhmm
UShhmm

Returns:
The time of day, formatted as a string.

formatTime

String formatTime()
Formats the time of day as a string, with delimiters between the different parts of this time. The formatting will include hour, minute and second.
FormatterFormat
ISOhh:mm:ss
EURhh:mm:ss
UShh:mm:ss

Returns:
The time of day, formatted as a string.

formatLongTime

String formatLongTime()
Formats the time of day as a string, with delimiters between the different parts of this time. The formatting will include hour, minute, second and millisecond.
FormatterFormat
ISOhh:mm:ss.nnn
EURhh:mm:ss.nnn
UShh:mm:ss.nnn

Returns:
The time of day, formatted as a string.

formatShortTime

String formatShortTime()
Formats the time of day as a string, with delimiters between the different parts of this time. The formatting will include hour and minute.
FormatterFormat
ISOhh:mm
EURhh:mm
UShh:mm

Returns:
The time of day, formatted as a string.


Copyright © 2013. All Rights Reserved.