org.springframework.richclient.text
Class TimeFormat

java.lang.Object
  extended by org.springframework.richclient.text.TimeFormat

public abstract class TimeFormat
extends Object

A text formatter that formats time periods (durations.)

Author:
Keith Donald

Constructor Summary
TimeFormat()
           
 
Method Summary
abstract  String format(long time)
          Returns a formatted time string for the specified time period.
static TimeFormat getDaysInstance()
          Returns a standard TimeFormat that formats using days, hours, minutes, and seconds.
static TimeFormat getMillisecondsInstance()
          Returns a TimeFormat that formats using days, hours, minutes, seconds, and milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeFormat

public TimeFormat()
Method Detail

getDaysInstance

public static TimeFormat getDaysInstance()
Returns a standard TimeFormat that formats using days, hours, minutes, and seconds.

The format looks like: 5d 23h 12m 52s.

Returns:
The daysInstance TimeFormatter.

getMillisecondsInstance

public static TimeFormat getMillisecondsInstance()
Returns a TimeFormat that formats using days, hours, minutes, seconds, and milliseconds.

The format looks like: 5d 23h 12m 52s 10ms.

Returns:
The millisecondsInstance TimeFormatter.

format

public abstract String format(long time)
Returns a formatted time string for the specified time period.

Parameters:
time - the time period.
Returns:
The formatted time string.


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.