public class PatternBasedTimeFormatter extends java.lang.Object implements TimeFormatter
Constructor and Description |
---|
PatternBasedTimeFormatter()
Constructor for a GeneralTimeFormatter.
|
PatternBasedTimeFormatter(boolean timeZoneIncluded)
Constructor for a GeneralTimeFormatter.
|
PatternBasedTimeFormatter(java.text.DateFormat dateFormat,
java.util.concurrent.TimeUnit coarsestUnit,
java.util.concurrent.TimeUnit finestUnit)
Constructor for a GeneralTimeFormatter.
|
PatternBasedTimeFormatter(java.lang.String pattern,
java.util.concurrent.TimeUnit coarsestUnit,
java.util.concurrent.TimeUnit finestUnit)
Constructor for a GeneralTimeFormatter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildTimeString(TimeInstant instant)
Returns the String-Representation of the given TimeInstant.
|
java.lang.String |
buildTimeString(TimeSpan span)
Returns the String-Representation of the given TimeSpan.
|
java.lang.String |
getUnit()
The units used to format time span and time instants.
|
public PatternBasedTimeFormatter()
public PatternBasedTimeFormatter(boolean timeZoneIncluded)
timeZoneIncluded
- boolean : inclusion of time zone identifiers (true) or not (false).public PatternBasedTimeFormatter(java.text.DateFormat dateFormat, java.util.concurrent.TimeUnit coarsestUnit, java.util.concurrent.TimeUnit finestUnit)
dateFormat
- DateFormat : the dateFormat used by this TimeFormatter.coarsestUnit
- TimeUnit: The coarsest Unit for the TimeSpanfinestUnit
- TimeUnit: The finest Unit for the TimeSpanpublic PatternBasedTimeFormatter(java.lang.String pattern, java.util.concurrent.TimeUnit coarsestUnit, java.util.concurrent.TimeUnit finestUnit)
pattern
- String : the pattern used by this UTCTimeFormatter to format
TimeSpan and TimeInstant objects. See
http://download.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html
for a description of the syntax of such patterns.coarsestUnit
- TimeUnit: The coarsest Unit for the TimeSpanfinestUnit
- TimeUnit: The finest Unit for the TimeSpanpublic java.lang.String buildTimeString(TimeInstant instant)
buildTimeString
in interface TimeFormatter
instant
- TimeInstant: the instant of time to be formattedpublic java.lang.String buildTimeString(TimeSpan span)
buildTimeString
in interface TimeFormatter
span
- TimeSpan: the instant of time to be formattedpublic java.lang.String getUnit()
TimeFormatter
getUnit
in interface TimeFormatter