|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ix.util.Util
Class for useful static methods.
Constructor Summary | |
Util()
|
Method Summary | |
static java.lang.String |
askLine(java.lang.String prompt)
Simple, text-based user interaction. |
static java.lang.String[] |
breakStringAtFirst(java.lang.String s,
java.lang.String separator)
breakStringAtFirst takes a string containing fields separated by a (string) delimiter and returns a two-element string array containing the substring before the first occurrence of the char, and the substring after. |
static void |
printLines(java.lang.String[] lines)
Print the elements of a String[] array to System.out as lines. |
static java.lang.String |
readLine(java.io.InputStream is)
Reads a line from an InputStream and returns it as a String. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Util()
Method Detail |
public static java.lang.String[] breakStringAtFirst(java.lang.String s, java.lang.String separator)
public static void printLines(java.lang.String[] lines)
public static java.lang.String askLine(java.lang.String prompt)
If askLine blocks when reading, we'd like other threads to be able to run; but that doesn't seem to happen reliably. Presumably, this is a bug. In any case, askLine works around the problem by having a loop that checks whether input is available and sleeps for a second if it isn't.
public static java.lang.String readLine(java.io.InputStream is)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |