Util
Class Util
java.lang.Object
|
+--Util.Util
- public final class Util
- extends java.lang.Object
A repository of miscellaneous utility functions.
Constructor Summary |
Util()
|
Method Summary |
static void |
DEBUG(java.lang.String debug)
print a debug formatted string |
static int |
Encode(int a,
int b)
given two int a<2^16 and b<2^16, encode returns a
non-commuatative encoding of a and b. |
static void |
ERR(java.lang.String err)
Print an error formatted string and exit app |
static void |
ERR(java.lang.String err,
java.lang.Exception e)
print an error message and stack trace and exit |
static void |
MSG(java.lang.String msg)
print a message formatted string |
static void |
MSGN(java.lang.String msg)
print a message formatted string but without an EOL character |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Util
public Util()
Encode
public static int Encode(int a,
int b)
- given two int a<2^16 and b<2^16, encode returns a
non-commuatative encoding of a and b. this is a handy little
encoding function to group two small integers into a single
32bit integer. an example of its use can be found in the
collision detection code in RouterModel.placeNodes()
- Parameters:
a
- integer < 2^16b
- integer < 2^16- Returns:
- int encoding of a,b
ERR
public static void ERR(java.lang.String err)
- Print an error formatted string and exit app
ERR
public static void ERR(java.lang.String err,
java.lang.Exception e)
- print an error message and stack trace and exit
DEBUG
public static void DEBUG(java.lang.String debug)
- print a debug formatted string
MSG
public static void MSG(java.lang.String msg)
- print a message formatted string
MSGN
public static void MSGN(java.lang.String msg)
- print a message formatted string but without an EOL character