List of utility methods to do StringBuilder Append
void | appendNormalisedWhitespace(StringBuilder accum, String string, boolean stripLeading) After normalizing the whitespace within a string, appends it to a string builder. boolean lastWasWhite = false; boolean reachedNonWhite = false; int len = string.length(); int c; for (int i = 0; i < len; i += Character.charCount(c)) { c = string.codePointAt(i); if (isWhitespace(c)) { if ((stripLeading && !reachedNonWhite) || lastWasWhite) ... |
StringBuilder | appendLine(final StringBuilder s, final CharSequence line) append Line if (s.length() > 0) { s.append("\n"); s.append(line); return s; |
String | appendStr(char splitTag, Object... strs) append Str if (null == strs) { return ""; StringBuilder str = new StringBuilder(); for (Object demp : strs) { str.append(demp); str.append(splitTag); return str.toString(); |
void | byteToString(StringBuilder sb, byte b) byte To String int unsigned_byte = b < 0 ? b + 256 : b; int hi = unsigned_byte / 16; int lo = unsigned_byte % 16; sb.append("0123456789ABCDEF".substring(hi, hi + 1)); sb.append("0123456789ABCDEF".substring(lo, lo + 1)); |
void | addStartLine(Object aObject, StringBuilder aResult) add Start Line aResult.append(aObject.getClass().getName());
aResult.append(" {");
aResult.append(NEW_LINE);
|
void | appendByteAsHex(StringBuilder sb, byte b) append Byte As Hex int unsignedByte = b & 0xFF; if (unsignedByte < 16) { sb.append("0"); sb.append(Integer.toHexString(unsignedByte)); |