org.jwall.web.audit.util
Class TimeFormat

java.lang.Object
  extended by org.jwall.web.audit.util.TimeFormat

public class TimeFormat
extends Object

This class provides some utility functions useful to format elapsed time (usually given in milliseconds).

Author:
Christian Bockermann <chris@jwall.org&g;

Field Summary
static long DAY_MS
           
static long HOUR_MS
           
static int LONG_FORMAT
           
static long MIN_MS
           
static long SEC_MS
           
static int SHORT_FORMAT
           
static long YEAR_MS
           
 
Constructor Summary
TimeFormat()
           
TimeFormat(int style)
           
 
Method Summary
 String format(long timeInMilliseconds)
           This method takes the given number of milliseconds, time, and creates a new String containing a description of the time by means of days, hours, minutes and seconds.
static String formatLong(long timeInMillis)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT_FORMAT

public static final int SHORT_FORMAT
See Also:
Constant Field Values

LONG_FORMAT

public static final int LONG_FORMAT
See Also:
Constant Field Values

SEC_MS

public static final long SEC_MS
See Also:
Constant Field Values

MIN_MS

public static final long MIN_MS
See Also:
Constant Field Values

HOUR_MS

public static final long HOUR_MS
See Also:
Constant Field Values

DAY_MS

public static final long DAY_MS
See Also:
Constant Field Values

YEAR_MS

public static final long YEAR_MS
See Also:
Constant Field Values
Constructor Detail

TimeFormat

public TimeFormat()

TimeFormat

public TimeFormat(int style)
Method Detail

format

public String format(long timeInMilliseconds)

This method takes the given number of milliseconds, time, and creates a new String containing a description of the time by means of days, hours, minutes and seconds. If time is less than any of the mentioned properties, then this field will not be printed, e.g.

This method is optimized over the old version (formatOld()

Parameters:
timeInMilliseconds - The time as an amount of milliseconds.
Returns:
The time formatted as printable string.

formatLong

public static String formatLong(long timeInMillis)


Copyright © 2012 jwall.org. All Rights Reserved.