Package org.jets3t.service.utils
Class TimeFormatter
- java.lang.Object
-
- org.jets3t.service.utils.TimeFormatter
-
public class TimeFormatter extends Object
Formats time values into human-readable strings.- Author:
- James Murty
-
-
Constructor Summary
Constructors Constructor Description TimeFormatter()
TimeFormatter(String hourSuffix, String hoursSuffix, String minuteSuffix, String minutesSuffix, String secondSuffix, String secondsSuffix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
formatTime(long seconds)
Formats a seconds time value into a brief representation, such as37 minutes
.String
formatTime(long seconds, boolean useUnicodeChars)
Formats a seconds time value into a brief representation, such as37 minutes
.
-
-
-
Method Detail
-
formatTime
public String formatTime(long seconds)
Formats a seconds time value into a brief representation, such as37 minutes
. Unicode characters are used to represent 1/4, 1/2 and 3/4 fractions.- Parameters:
seconds
- the number of seconds time value.- Returns:
- a representation of the time.
-
formatTime
public String formatTime(long seconds, boolean useUnicodeChars)
Formats a seconds time value into a brief representation, such as37 minutes
.- Parameters:
seconds
- the number of seconds time value.useUnicodeChars
- if true, special unicode characters are used to represent 1/4, 1/2 and 3/4 fractions. If false, the fractions are displayed in standard text.- Returns:
- a representation of the time.
-
-