/** * Append the specified number within a space (number of spaces) specified * by the width. E.g. "15 " where number is 15 and width is 4. */ @Override public void append(final int number, final int width) { appendIndent(); final int len = string.length(); string.append(number); regularizeWidth(width, len); }
/** * Append the specified object by calling its <code>toString()</code> * method, placing it within specified space. */ @Override public void append(final Object object, final int width) { appendIndent(); final int len = string.length(); string.append(object); regularizeWidth(width, len); }
/** * Append the specified object with the specified label, then start a new * line. */ @Override public void appendln(final String label, final Object object) { appendIndent(); string.append(label); final int spaces = COLUMN_SPACING - label.length(); string.append(": " + spaces(spaces > 0 ? spaces : 0)); string.append(object); string.append('\n'); newLine = true; }
/** * Append the specified text, then start a new line. */ @Override public void appendln(final String text) { appendIndent(); append(text); appendln(); newLine = true; }
/** * Append the specified object by calling it <code>toString()</code> method. */ @Override public void append(final Object object) { if (object instanceof DebuggableWithTitle) { indent(); appendTitle(((DebuggableWithTitle) object).debugTitle()); ((DebuggableWithTitle) object).debugData(this); unindent(); } else { appendIndent(); string.append(object); } }