|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jutil.TRuntime
public final class TRuntime
This is the TAssert utility code class.
| Field Summary | |
|---|---|
static int |
SIZEOF_INT
SIZEOF_INT, convienence variable representing the size of an int (4) |
static int |
SIZEOF_K
Convienence variable representing the size of an kilobyte (1024) |
static int |
SIZEOF_LONG
Convienence variable representing the size of an long (8) |
static int |
SIZEOF_MEG
Convienence variable representing the size of a megabyte (1024*1024) |
| Constructor Summary | |
|---|---|
TRuntime()
Ensure that no one can create instances of this Class. |
|
| Method Summary | |
|---|---|
static java.lang.String |
formatAsK(int i)
Convienence method for formatting as kilobytes e.g. |
static java.lang.String |
formatAsK(long l)
Convienence method for formatting as kilobytes e.g. |
static java.lang.String |
formatAsK(java.lang.Number n)
Convienence method for formatting as kilobytes e.g. |
static java.lang.String |
formatAsMB(int i)
Convienence method for formatting as megabytes e.g. |
static java.lang.String |
formatAsMB(long bytes)
Convienence method for formatting as megabytes e.g. |
static java.lang.String |
formatAsMB(java.lang.Number bytes)
Convienence method for formatting as megabytes e.g. |
static long |
getFreeMem()
USAGE: org.jutil.TRuntime.getFreeMem(); |
static float |
getJavaVersion()
|
static float |
getMemFreeAsPercent()
USAGE: org.jutil.TRuntime.getMemFreeAsPercent(); |
static float |
getMemUsedAsPercent()
USAGE: org.jutil.TRuntime.getMemUsedAsPercent(); |
static java.lang.String |
getSystemState()
USAGE: org.jutil.TRuntime.getSystemState(); |
static long |
getTotalMem()
USAGE: org.jutil.TRuntime.getTotalMem(); |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SIZEOF_INT
Usage:
System.out.println("Size of int == " +org.jutil.TRuntime.SIZEOF_INT);
public static final int SIZEOF_LONG
Usage:
System.out.println("Size of long == " +org.jutil.TRuntime.SIZEOF_LONG);
public static final int SIZEOF_K
Usage:
System.out.println("Size of kilobyte == " +org.jutil.TRuntime.SIZEOF_K);
public static final int SIZEOF_MEG
Usage:
System.out.println("Size of megabyte == " +org.jutil.TRuntime.SIZEOF_MEG);
1MB=1048576, 2MB=2097152, 5MB=5242880, 10MB=10485760, 50MB=52428800
| Constructor Detail |
|---|
public TRuntime()
| Method Detail |
|---|
public static final java.lang.String getSystemState()
public static final long getTotalMem()
public static final long getFreeMem()
public static final float getMemUsedAsPercent()
public static final float getMemFreeAsPercent()
public static final java.lang.String formatAsK(int i)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsK(1024);
i - - int value to formatpublic static final java.lang.String formatAsMB(int i)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsMB(1048576));
i - - int value to formatpublic static final java.lang.String formatAsK(long l)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsK(1500l));
i - - long value to formatpublic static final java.lang.String formatAsMB(long bytes)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsMB(1048576l));
i - - long value to formatpublic static final java.lang.String formatAsK(java.lang.Number n)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsK(new Long(1024)));
i - - Number value to formatpublic static final java.lang.String formatAsMB(java.lang.Number bytes)
Usage:
System.out.println("mem == " +org.jutil.TRuntime.formatAsMB(new Long(1048576l)));
i - - Number value to formatpublic static final float getJavaVersion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||