|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.text.Format
java.text.MessageFormat
de.sciss.gui.TimeFormat
public class TimeFormat
A MessageFormat
subclass for
displaying time values in minutes
and seconds.
NumberField.HHMMSS
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.text.MessageFormat |
---|
java.text.MessageFormat.Field |
Constructor Summary | |
---|---|
TimeFormat(int flags,
java.lang.String prefix,
java.lang.String suffix,
int numDecimals,
java.util.Locale locale)
Constructs a new TimeFormat
with automatically created pattern. |
Method Summary | |
---|---|
java.lang.String |
formatTime(java.lang.Number seconds)
Creates a formatted string using a parameter for seconds |
java.lang.Number |
parseTime(java.lang.String str)
Tries to parse a formatted time string (as produced by formatTime ). |
Methods inherited from class java.text.MessageFormat |
---|
applyPattern, clone, equals, format, format, format, formatToCharacterIterator, getFormats, getFormatsByArgumentIndex, getLocale, hashCode, parse, parse, parseObject, setFormat, setFormatByArgumentIndex, setFormats, setFormatsByArgumentIndex, setLocale, toPattern |
Methods inherited from class java.text.Format |
---|
format, parseObject |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeFormat(int flags, java.lang.String prefix, java.lang.String suffix, int numDecimals, java.util.Locale locale)
TimeFormat
with automatically created pattern.
flags
- 0 at the momentprefix
- a string to prepend to the formatted string, or null
suffix
- a string to append to the formatted string, or null
numDecimals
- number of decimals, e.g. 3 for millisecs, 0 for secslocale
- Locale
to choose for number formattingMethod Detail |
---|
public java.lang.String formatTime(java.lang.Number seconds)
seconds
- the time in seconds which will
be formatted using an MM:SS.millis pattern
public java.lang.Number parseTime(java.lang.String str) throws java.text.ParseException
formatTime
).
str
- a formatted string such as "12:33.456"
java.text.ParseException
- if the string cannot be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |