/** Appends the contents of the specified string, then create a new line. If the string is {@code null}, then the string * {@code "null"} is appended. * * @param str the string to append. * @return this builder. */ public StringBuilder appendLine (String str) { append0(str); append0('\n'); return this; }
/** Appends the string representation of the specified {@code boolean} value. The {@code boolean} value is converted to a * String according to the rule defined by {@link String#valueOf(boolean)}. * * @param b the {@code boolean} value to append. * @return this builder. * @see String#valueOf(boolean) */ public StringBuilder append (boolean b) { append0(b ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ return this; }
/** Appends the string representation of the specified {@code boolean} value. The {@code boolean} value is converted to a * String according to the rule defined by {@link String#valueOf(boolean)}. * * @param b the {@code boolean} value to append. * @return this builder. * @see String#valueOf(boolean) */ public StringBuilder append (boolean b) { append0(b ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ return this; }
/** Appends the string representation of the specified {@code char} value. The {@code char} value is converted to a string * according to the rule defined by {@link String#valueOf(char)}. * * @param c the {@code char} value to append. * @return this builder. * @see String#valueOf(char) */ public StringBuilder append (char c) { append0(c); return this; }
/** Appends the contents of the specified string. If the string is {@code null}, then the string {@code "null"} is appended. * * @param str the string to append. * @return this builder. */ public StringBuilder append (String str) { append0(str); return this; }
/** Appends the string representation of the specified {@code char} value. The {@code char} value is converted to a string * according to the rule defined by {@link String#valueOf(char)}. * * @param c the {@code char} value to append. * @return this builder. * @see String#valueOf(char) */ public StringBuilder append (char c) { append0(c); return this; }
/** Appends the contents of the specified string, then create a new line. If the string is {@code null}, then the string * {@code "null"} is appended. * * @param str the string to append. * @return this builder. */ public StringBuilder appendLine (String str) { append0(str); append0('\n'); return this; }
/** Appends the string representation of the specified {@code char[]}. The {@code char[]} is converted to a string according to * the rule defined by {@link String#valueOf(char[])}. * * @param ch the {@code char[]} to append.. * @return this builder. * @see String#valueOf(char[]) */ public StringBuilder append (char[] ch) { append0(ch); return this; }
/** Appends the contents of the specified string. If the string is {@code null}, then the string {@code "null"} is appended. * * @param str the string to append. * @return this builder. */ public StringBuilder append (String str) { append0(str); return this; }
/** Appends the encoded Unicode code point. The code point is converted to a {@code char[]} as defined by * {@link Character#toChars(int)}. * * @param codePoint the Unicode code point to encode and append. * @return this builder. * @see Character#toChars(int) */ public StringBuilder appendCodePoint (int codePoint) { append0(Character.toChars(codePoint)); return this; }
/** Appends the encoded Unicode code point. The code point is converted to a {@code char[]} as defined by * {@link Character#toChars(int)}. * * @param codePoint the Unicode code point to encode and append. * @return this builder. * @see Character#toChars(int) */ public StringBuilder appendCodePoint (int codePoint) { append0(Character.toChars(codePoint)); return this; }
/** Appends the string representation of the specified {@code float} value. The {@code float} value is converted to a string * according to the rule defined by {@link String#valueOf(float)}. * * @param f the {@code float} value to append. * @return this builder. */ public StringBuilder append (float f) { append0(Float.toString(f)); return this; }
/** Appends the string representation of the specified {@code double} value. The {@code double} value is converted to a string * according to the rule defined by {@link String#valueOf(double)}. * * @param d the {@code double} value to append. * @return this builder. * @see String#valueOf(double) */ public StringBuilder append (double d) { append0(Double.toString(d)); return this; }
/** Appends the string representation of the specified {@code float} value. The {@code float} value is converted to a string * according to the rule defined by {@link String#valueOf(float)}. * * @param f the {@code float} value to append. * @return this builder. */ public StringBuilder append (float f) { append0(Float.toString(f)); return this; }
final void append0 (CharSequence s, int start, int end) { if (s == null) { s = "null"; } if (start < 0 || end < 0 || start > end || end > s.length()) { throw new IndexOutOfBoundsException(); } append0(s.subSequence(start, end).toString()); }
final void append0 (CharSequence s, int start, int end) { if (s == null) { s = "null"; } if (start < 0 || end < 0 || start > end || end > s.length()) { throw new IndexOutOfBoundsException(); } append0(s.subSequence(start, end).toString()); }
public StringBuilder append (StringBuilder builder) { if (builder == null) appendNull(); else append0(builder.chars, 0, builder.length); return this; }
public StringBuilder append (StringBuilder builder) { if (builder == null) appendNull(); else append0(builder.chars, 0, builder.length); return this; }
public StringBuilder append (StringBuilder builder, int start, int end) { if (builder == null) appendNull(); else append0(builder.chars, start, end); return this; }
public StringBuilder append (StringBuilder builder, int start, int end) { if (builder == null) appendNull(); else append0(builder.chars, start, end); return this; }