net.sourceforge.cobertura.javancss
Class Util
java.lang.Object
net.sourceforge.cobertura.javancss.Util
A general purpose class with a variety of support and convenience methods.
There are different groups of methods in this class:
print methods - convenience methods for System.out.print etc. that additionally make sure output is gets flushed immediately.
string methods
string/vector converter methods
miscellaneous methods
Some basic but none the less the most used methods by myself are:
-
isEmpty
-
stringToLines
-
sleep
Util() - This is an utility class, there is (should be) no need
for an instance of this class.
|
static boolean | isEmpty(String sTest_) - Tests, if a given String equals null or "".
|
(package private) static void | panicIf(boolean bPanic_) - panicIf <=> not assert.
|
(package private) static void | panicIf(boolean bPanic_, String sMessage_) - panicIf <=> not assert.
|
private static void | sleep(int seconds_) - Current thread sleeps in seconds.
|
static Vector | stringToLines(String pString_) - This function takes a String and separates it into different
lines.
|
private static Vector | stringToLines(String pString_, char cCutter_) - This function takes a String and separates it into different
lines.
|
private static Vector | stringToLines(int lines_, String pString_, char cCutter_) - This function takes a String and separates it into different
lines.
|
Util
private Util()
This is an utility class, there is (should be) no need
for an instance of this class.
isEmpty
public static boolean isEmpty(String sTest_)
Tests, if a given String equals null or "".
panicIf
(package private) static void panicIf(boolean bPanic_)
panicIf <=> not assert. Throws ApplicationException if true.
It's not necessary to catch this exception.
panicIf
(package private) static void panicIf(boolean bPanic_,
String sMessage_)
panicIf <=> not assert. Throws ApplicationException if true.
It's not necessary to catch this exception.
sMessage_
- The error message for the Exception.
sleep
private static void sleep(int seconds_)
Current thread sleeps in seconds.
stringToLines
public static Vector stringToLines(String pString_)
This function takes a String and separates it into different
lines. The last line does not need to have a '\n'. The function
can't handle dos carriage returns.
- The single lines do not contain the '\n' character
at the end.
stringToLines
private static Vector stringToLines(String pString_,
char cCutter_)
This function takes a String and separates it into different
lines. The last line does not need to have a separator character.
cCutter_
- The character that separates pString_ into
different lines
- The single lines do not contain the cCutter_ character
at the end.
stringToLines
private static Vector stringToLines(int lines_,
String pString_,
char cCutter_)
This function takes a String and separates it into different
lines. The last line does not need to have a separator character.
lines_
- The number of lines that should be extracted.
Zero if maximum number of lines is requested.cCutter_
- The character that separates pString_ into
different lines
- The single lines do not contain the cCutter_
character at the end.