|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.TimeFormat
TimeFormat is a utility class for converting a long into a human readable string.
Example usage:
System.out.println("You have been online for: "+TimeFormat.valueOf(milliseconds));
FIXME: expanded features need documentation. JGH
Field Summary | |
static boolean |
DEBUG
|
static long |
ONE_DAY
|
static long |
ONE_HOUR
|
static long |
ONE_MILLISECOND
|
static long |
ONE_MINUTE
|
static long |
ONE_SECOND
|
static int |
ROUND_TO_DAY
|
static int |
ROUND_TO_HOUR
|
static int |
ROUND_TO_MILLISECOND
|
static int |
ROUND_TO_MINUTE
|
static int |
ROUND_TO_SECOND
|
Method Summary | |
void |
add(TimeFormat t)
add a timeformat |
String |
format(int round)
format string based on rouding |
static String |
format(String format,
long time)
format with a date time |
long |
getDays()
get days |
void |
getDays(TimeFormat t)
get days from a time format |
long |
getHours()
get hours |
void |
getHours(TimeFormat t)
get hours from a time format |
long |
getMilliseconds()
get the milliseconds |
long |
getMinutes()
get minutes |
void |
getMinutes(TimeFormat t)
get minutes from a time format |
int |
getRouding()
return the rounding |
long |
getSeconds()
get seconds |
void |
getSeconds(TimeFormat t)
get seconds from a time format |
void |
getTime(TimeFormat t)
update time |
static void |
main(String[] args)
test |
void |
setRounding(int r)
set rounding - one of ROUND_TO_MILLISECONDS, etc. |
String |
toString()
print out the time format in a string representation |
static String |
valueOf(long t)
return a string formatted version of time t
rounding to round |
static String |
valueOf(long t,
int round)
return a string formatted version of time t
rounding to round |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final boolean DEBUG
public static final long ONE_MILLISECOND
public static final long ONE_SECOND
public static final long ONE_MINUTE
public static final long ONE_HOUR
public static final long ONE_DAY
public static final int ROUND_TO_MILLISECOND
public static final int ROUND_TO_SECOND
public static final int ROUND_TO_MINUTE
public static final int ROUND_TO_HOUR
public static final int ROUND_TO_DAY
Method Detail |
public long getDays()
public long getMinutes()
public long getHours()
public long getSeconds()
public void add(TimeFormat t)
t
- public void getDays(TimeFormat t)
t
- public void getHours(TimeFormat t)
t
- public void getMinutes(TimeFormat t)
t
- public void getSeconds(TimeFormat t)
t
- public void getTime(TimeFormat t)
t
- public long getMilliseconds()
public String toString()
public void setRounding(int r)
public int getRouding()
public String format(int round)
public static String valueOf(long t, int round)
t
rounding to round
t
- round
-
public static String valueOf(long t)
t
rounding to round
t
-
public static String format(String format, long time)
public static void main(String[] args)
args
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |