|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectst.ata.util.X
A collection of useful static methods.
Field Summary | |
static int |
DEBUG
|
Constructor Summary | |
X()
|
Method Summary | |
static void |
check(boolean b)
Throws a runtime exception if b is not true. |
static void |
check(boolean b,
java.lang.String m)
Throws a runtime exception if b is not true. |
static void |
checkargs(boolean b)
Throws an illegal argument exception if b is not true. |
static void |
checkstate(boolean b)
Throws an illegal state exception if b is not true. |
static int |
decodeInt(byte[] buf,
int offset)
|
static long |
decodeLong(byte[] buf,
int offset)
|
static int |
decodeShort(byte[] buf,
int offset)
|
static java.util.ArrayList |
dupElim(java.util.ArrayList al,
java.util.Comparator cm)
|
static void |
encodeInt(byte[] buf,
int offset,
int val)
|
static void |
encodeLong(byte[] buf,
int offset,
long val)
|
static void |
encodeShort(byte[] buf,
int offset,
int val)
|
static void |
fail(java.lang.String m)
Throws a runtime exception with message m . |
static java.lang.String |
getFullDescription(java.lang.Throwable t)
Returns a full description of a Throwable . |
static void |
log(java.lang.String ctxt,
java.util.logging.Level level,
java.lang.String msg)
|
static void |
log(java.lang.String ctxt,
java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable t)
|
static void |
noimpl()
|
static void |
popTrace(java.lang.Throwable t,
int n)
Removes the top n stack-trace elements from
t . |
static java.lang.String |
printable(byte[] data)
returns the printable representation of data
after escaping non-printable characters in C style. |
static java.lang.String |
printable(byte[] data,
int start,
int end)
returns the printable representation of data
from start (inclusive) to end (exclusive). |
static void |
printArgs(java.lang.String programName,
java.lang.String[] args)
print out the programName and arguments used |
static void |
testFailure(java.lang.String systemProperty)
Throws a runtime exception with message systemProperty . |
static java.lang.RuntimeException |
toRTE(java.lang.Exception e)
Returns an UndeclaredThrowableException
wrapping e . |
static void |
ut(boolean b)
Same as |
static void |
ut(boolean b,
java.lang.String m)
Test condition during unit testing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEBUG
Constructor Detail |
public X()
Method Detail |
public static void fail(java.lang.String m)
m
.
public static void testFailure(java.lang.String systemProperty)
systemProperty
.
systemProperty
- a String
value which specifies
a boolean system property, which if true will cause
an exception to be thrown.public static void check(boolean b)
b
is not true.
public static void check(boolean b, java.lang.String m)
b
is not true.
public static void checkargs(boolean b)
b
is not true.
public static void checkstate(boolean b)
b
is not true.
public static java.lang.RuntimeException toRTE(java.lang.Exception e)
UndeclaredThrowableException
wrapping e
.
public static void ut(boolean b)
public static void ut(boolean b, java.lang.String m)
public static void printArgs(java.lang.String programName, java.lang.String[] args)
public static void noimpl()
public static java.lang.String getFullDescription(java.lang.Throwable t)
Throwable
. This full
description includes a stack trace. This method will never
throw an error or exception: if something bad happens, it
simply returns null.
public static void popTrace(java.lang.Throwable t, int n)
n
stack-trace elements from
t
. This is useful inside methods like fail(java.lang.String)
to help debuggers more quickly identify the location of
a failure.
public static int decodeInt(byte[] buf, int offset)
public static int decodeShort(byte[] buf, int offset)
public static void encodeShort(byte[] buf, int offset, int val)
public static void encodeInt(byte[] buf, int offset, int val)
public static long decodeLong(byte[] buf, int offset)
public static void encodeLong(byte[] buf, int offset, long val)
public static java.lang.String printable(byte[] data)
data
after escaping non-printable characters in C style.
public static java.lang.String printable(byte[] data, int start, int end)
data
from start
(inclusive) to end
(exclusive).
after escaping non-printable characters in C style.
data
may not be null
and
start
must be smaller or equal to end
Both start
and end
are bounded by
0
and data.length
bot inclusive.
public static void log(java.lang.String ctxt, java.util.logging.Level level, java.lang.String msg, java.lang.Throwable t)
public static void log(java.lang.String ctxt, java.util.logging.Level level, java.lang.String msg)
public static java.util.ArrayList dupElim(java.util.ArrayList al, java.util.Comparator cm)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |