/** * Inserts the string representation of the {@code double} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(double)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param d a {@code double}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, double d) { return insert(offset, String.valueOf(d)); }
/** * Inserts the string representation of the {@code float} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(float)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param f a {@code float}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, float f) { return insert(offset, String.valueOf(f)); }
/** * Inserts the string representation of the {@code long} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(long)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param l a {@code long}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, long l) { return insert(offset, String.valueOf(l)); }
/** * Inserts the specified {@code CharSequence} into this sequence. * <p> * The characters of the {@code CharSequence} argument are inserted, * in order, into this sequence at the indicated offset, moving up * any characters originally above that position and increasing the length * of this sequence by the length of the argument s. * <p> * The result of this method is exactly the same as if it were an * invocation of this object's * {@link #insert(int, CharSequence, int, int) insert}(dstOffset, s, 0, s.length()) * method. * <p> * <p>If {@code s} is {@code null}, then the four characters * {@code "null"} are inserted into this sequence. * * @param dstOffset the offset. * @param s the sequence to be inserted * @return a reference to this object. * @throws IndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int dstOffset, CharSequence s) { if (s == null) s = "null"; if (s instanceof String) return this.insert(dstOffset, (String) s); return this.insert(dstOffset, s, 0, s.length()); }
/** * Inserts the specified {@code CharSequence} into this sequence. * <p> * The characters of the {@code CharSequence} argument are inserted, * in order, into this sequence at the indicated offset, moving up * any characters originally above that position and increasing the length * of this sequence by the length of the argument s. * <p> * The result of this method is exactly the same as if it were an * invocation of this object's * {@link #insert(int, CharSequence, int, int) insert}(dstOffset, s, 0, s.length()) * method. * <p> * <p>If {@code s} is {@code null}, then the four characters * {@code "null"} are inserted into this sequence. * * @param dstOffset the offset. * @param s the sequence to be inserted * @return a reference to this object. * @throws IndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int dstOffset, CharSequence s) { if (s == null) s = "null"; if (s instanceof String) return this.insert(dstOffset, (String) s); return this.insert(dstOffset, s, 0, s.length()); }
/** * Inserts the string representation of the {@code double} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(double)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param d a {@code double}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, double d) { return insert(offset, String.valueOf(d)); }
/** * Inserts the string representation of the second {@code int} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(int)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param i an {@code int}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, int i) { return insert(offset, String.valueOf(i)); }
/** * Inserts the string representation of the {@code boolean} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(boolean)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param b a {@code boolean}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, boolean b) { return insert(offset, String.valueOf(b)); }
/** * Inserts the string representation of the {@code long} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(long)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param l a {@code long}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, long l) { return insert(offset, String.valueOf(l)); }
/** * Inserts the string representation of the second {@code int} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(int)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param i an {@code int}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, int i) { return insert(offset, String.valueOf(i)); }
/** * Inserts the string representation of the {@code float} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(float)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param f a {@code float}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, float f) { return insert(offset, String.valueOf(f)); }
/** * Inserts the string representation of the {@code Object} * argument into this character sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(Object)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param obj an {@code Object}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, Object obj) { return insert(offset, String.valueOf(obj)); }
/** * Inserts the string representation of the {@code Object} * argument into this character sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(Object)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param obj an {@code Object}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, Object obj) { return insert(offset, String.valueOf(obj)); }
/** * Inserts the string representation of the {@code boolean} * argument into this sequence. * <p> * The overall effect is exactly as if the second argument were * converted to a string by the method {@link String#valueOf(boolean)}, * and the characters of that string were then * {@link #insert(int, String) inserted} into this character * sequence at the indicated offset. * <p> * The {@code offset} argument must be greater than or equal to * {@code 0}, and less than or equal to the {@linkplain #length() length} * of this sequence. * * @param offset the offset. * @param b a {@code boolean}. * @return a reference to this object. * @throws StringIndexOutOfBoundsException if the offset is invalid. */ public Buffer insert(int offset, boolean b) { return insert(offset, String.valueOf(b)); }