/** Print a line; the previous value (if any) is automatically cleared. */ public void print(Object e) { String s = ""; if (e != null) s = e.toString(); System.out.print(JwUtility.repeat(BACKSPACE, _valueLength)); System.out.print(s); _valueLength = s.length(); }
/** * Print the string, right padded to the specified length. This also erases the previous string * (if any) that was printed using this method. It is important to use the name length each time * in order to clear the previous value printed. */ public static void print(Object e, int n) { String s = ""; if (e != null) s = e.toString(); s = JwUtility.truncate(s, n); s = JwUtility.rightPad(s, n); System.out.print(s); System.out.print(JwUtility.repeat(BACKSPACE, n)); }