public class SingleUnitTimeFormatter extends java.lang.Object implements TimeFormatter
Constructor and Description |
---|
SingleUnitTimeFormatter(java.util.concurrent.TimeUnit unit,
java.util.concurrent.TimeUnit epsilon,
int floats,
boolean writeUnit)
Constructs a DecimalTimeFormatter.
|
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 SingleUnitTimeFormatter(java.util.concurrent.TimeUnit unit, java.util.concurrent.TimeUnit epsilon, int floats, boolean writeUnit)
unit
- java.util.concurrent.TimeUnit : The time values that will be
usedfloats
- int : The number of floating point digits to printwriteUnit
- boolean : Indicates if the time unit will be included in the
time String.public 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