|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrebuild.util.Utilities
public final class Utilities
A collection of various utility functions.
Method Summary | |
---|---|
static void |
assert(boolean condition)
Checks for a condition; if the condition is false, outputs two specified messages and displays a message box that shows the message. |
static void |
assert(boolean condition,
java.lang.String message)
Checks for a condition; if the condition is false, outputs two specified messages and displays a message box that shows the message. |
static void |
assert(boolean condition,
java.lang.String message,
java.lang.String detailMessage)
Checks for a condition; if the condition is false, outputs two specified messages and displays a message box that shows the message. |
static java.lang.String |
ctime(java.util.Calendar timer)
Format a Calendar in the same manner as the Standard C function "ctime" |
static void |
getNonZeroBytes(byte[] data)
Get multiple random numbers., no zeros |
static void |
getNonZeroBytes(int[] data)
Get multiple random numbers., no zeros |
static boolean |
isDisabled(Field f)
Determine if the specified field is disabled. |
static void |
RNGGetBytes(byte[] data)
Get multiple random numbers. |
static void |
RNGGetBytes(int[] data)
Get multiple random numbers. |
static void |
setDisabled(Field f,
boolean isDisabled)
Set the field to either enabled/disabled. |
static boolean |
setupPermissions(int[] requiredPerms)
Setup application permissions, this will assign a set of permissions to a application. |
static java.lang.Object |
singletonStorageGet(long uid)
Get a singleton object. |
static java.lang.Object |
singletonStorageSet(long uid,
java.lang.Object obj)
Set a singleton object. |
static void |
singltonStorageCleanup()
Remove all singleton objects. |
static java.lang.Object[] |
toArray(java.util.Vector vect)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void RNGGetBytes(byte[] data)
data
- The array of bytes to fill with random numbers.
java.lang.NullPointerException
- If data is null.public static void getNonZeroBytes(byte[] data)
data
- The array of bytes to fill with random numbers.
java.lang.NullPointerException
- If data is null.public static void RNGGetBytes(int[] data)
data
- The array of bytes to fill with random numbers.
java.lang.NullPointerException
- If data is null.public static void getNonZeroBytes(int[] data)
data
- The array of bytes to fill with random numbers.
java.lang.NullPointerException
- If data is null.public static java.lang.Object[] toArray(java.util.Vector vect)
Vector
to an array.
vect
- The Vector
to convert to an array.
null
then null
is returned. Else an array is returned of the
items in vect.public static void assert(boolean condition)
condition
- The conditional expression to evaluate. If this is true
, the specified messages are not sent and the message box is not displayed.public static void assert(boolean condition, java.lang.String message)
condition
- The conditional expression to evaluate. If this is true
, the specified messages are not sent and the message box is not displayed.message
- A general message.public static void assert(boolean condition, java.lang.String message, java.lang.String detailMessage)
condition
- The conditional expression to evaluate. If this is true
, the specified messages are not sent and the message box is not displayed.message
- A general message.detailMessage
- A detailed message.public static boolean setupPermissions(int[] requiredPerms)
requiredPerms
- An array of the required permissions, this should be permissions from ApplicationPermissions
.
public static void setDisabled(Field f, boolean isDisabled)
f
- The field to enabled/disabled.isDisabled
- True if the field should be disabled, false if otherwise.public static boolean isDisabled(Field f)
f
- The field to check.
public static java.lang.String ctime(java.util.Calendar timer)
timer
- The calendar to format.
public static java.lang.Object singletonStorageGet(long uid)
singltonStorageCleanup()
is called.
uid
- The ID of the object to get.
singletonStorageSet(long, Object)
) or null if it doesn't exist or was not set using singletonStorageSet(long, Object)
.public static java.lang.Object singletonStorageSet(long uid, java.lang.Object obj)
uid
- The ID of the object to set. If this happens to be an object that already exists but was not set using this function then an exception will be thrown.obj
- The singleton object to set or null if the current object should be removed.
singletonStorageSet(long, Object)
) or null if it didn't exist or was not set using singletonStorageSet(long, Object)
.public static void singltonStorageCleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |