/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character array into this buffer at the specified offset. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @throws NullPointerException * if {@code chars} is {@code null}. */ public synchronized StringBuffer insert(int index, char[] chars) { insert0(index, chars); return this; }
/** * Inserts the string into this buffer at the specified offset. * <p> * If the specified string is {@code null}, the string {@code "null"} is * inserted, otherwise the contents of the string is inserted. * * @param index * the index at which to insert. * @param string * the string to insert (may be null). * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, String string) { insert0(index, string); return this; }
/** * Inserts the specified subsequence of characters into this buffer at the * specified index. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @param start * the starting offset. * @param length * the number of characters. * @return this buffer. * @throws NullPointerException * if {@code chars} is {@code null}. * @throws StringIndexOutOfBoundsException * if {@code length < 0}, {@code start < 0}, {@code start + * length > chars.length}, {@code index < 0} or {@code index > * length()} */ public synchronized StringBuffer insert(int index, char[] chars, int start, int length) { insert0(index, chars, start, length); return this; }
/** * Inserts the specified subsequence into this buffer at the specified * index. * <p> * If the specified CharSequence is {@code null}, the string {@code "null"} * is inserted, otherwise the contents of the CharSequence. * * @param index * The index at which to insert. * @param s * The char sequence to insert. * @param start * The inclusive start index in the char sequence. * @param end * The exclusive end index in the char sequence. * @return this buffer. * @throws IndexOutOfBoundsException * if {@code index} is negative or greater than the current * length, {@code start} or {@code end} are negative, {@code * start} is greater than {@code end} or {@code end} is greater * than the length of {@code s}. * @since 1.5 */ public synchronized StringBuffer insert(int index, CharSequence s, int start, int end) { insert0(index, s, start, end); return this; }
/** * Inserts the specified CharSequence into this buffer at the specified * index. * <p> * If the specified CharSequence is {@code null}, the string {@code "null"} * is inserted, otherwise the contents of the CharSequence. * * @param index * The index at which to insert. * @param s * The char sequence to insert. * @return this buffer. * @throws IndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @since 1.5 */ public synchronized StringBuffer insert(int index, CharSequence s) { insert0(index, s == null ? "null" : s.toString()); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the string into this buffer at the specified offset. * <p> * If the specified string is {@code null}, the string {@code "null"} is * inserted, otherwise the contents of the string is inserted. * * @param index * the index at which to insert. * @param string * the string to insert (may be null). * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, String string) { insert0(index, string); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character into this buffer at the specified offset. * * @param index * the index at which to insert. * @param ch * the character to insert. * @return this buffer. * @throws ArrayIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, char ch) { insert0(index, ch); return this; }
/** * Inserts the character array into this buffer at the specified offset. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @throws NullPointerException * if {@code chars} is {@code null}. */ public synchronized StringBuffer insert(int index, char[] chars) { insert0(index, chars); return this; }
/** * Inserts the character array into this buffer at the specified offset. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @throws NullPointerException * if {@code chars} is {@code null}. */ public synchronized StringBuffer insert(int index, char[] chars) { insert0(index, chars); return this; }
/** * Inserts the string into this buffer at the specified offset. * <p> * If the specified string is {@code null}, the string {@code "null"} is * inserted, otherwise the contents of the string is inserted. * * @param index * the index at which to insert. * @param string * the string to insert (may be null). * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, String string) { insert0(index, string); return this; }
/** * Inserts the string into this buffer at the specified offset. * <p> * If the specified string is {@code null}, the string {@code "null"} is * inserted, otherwise the contents of the string is inserted. * * @param index * the index at which to insert. * @param string * the string to insert (may be null). * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, String string) { insert0(index, string); return this; }
/** * Inserts the character array into this buffer at the specified offset. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @throws NullPointerException * if {@code chars} is {@code null}. */ public synchronized StringBuffer insert(int index, char[] chars) { insert0(index, chars); return this; }
/** * Inserts the character array into this buffer at the specified offset. * * @param index * the index at which to insert. * @param chars * the character array to insert. * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. * @throws NullPointerException * if {@code chars} is {@code null}. */ public synchronized StringBuffer insert(int index, char[] chars) { insert0(index, chars); return this; }
/** * Inserts the string into this buffer at the specified offset. * <p> * If the specified string is {@code null}, the string {@code "null"} is * inserted, otherwise the contents of the string is inserted. * * @param index * the index at which to insert. * @param string * the string to insert (may be null). * @return this buffer. * @throws StringIndexOutOfBoundsException * if {@code index < 0} or {@code index > length()}. */ public synchronized StringBuffer insert(int index, String string) { insert0(index, string); return this; }