/** * Appends the string representation of the <code>char</code> * argument to this string buffer. * <p> * The argument is appended to the contents of this string buffer. * The length of this string buffer increases by <code>1</code>. * * @param ch a <code>char</code>. * @return this string buffer. */ public final FastStringBuffer append(char c) { int newcount = count + 1; if (newcount > value.length) { expandCapacity(newcount); } value[count++] = c; return this; }
/** * Appends the string representation of the <code>char</code> * argument to this string buffer. * <p> * The argument is appended to the contents of this string buffer. * The length of this string buffer increases by <code>1</code>. * * @param ch a <code>char</code>. * @return this string buffer. */ public final FastStringBuffer append(char c) { int newcount = count + 1; if (newcount > value.length) { expandCapacity(newcount); } value[count++] = c; return this; }
/** * Appends the string representation of the <code>char</code> array * argument to this string buffer. * <p> * The characters of the array argument are appended, in order, to * the contents of this string buffer. The length of this string * buffer increases by the length of the argument. * * @param str the characters to be appended. * @return this string buffer. */ public final FastStringBuffer append(char str[]) { int len = str.length; int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(str, 0, value, count, len); count = newcount; return this; }
/** * Appends the string representation of a subarray of the * <code>char</code> array argument to this string buffer. * <p> * Characters of the character array <code>str</code>, starting at * index <code>offset</code>, are appended, in order, to the contents * of this string buffer. The length of this string buffer increases * by the value of <code>len</code>. * * @param str the characters to be appended. * @param offset the index of the first character to append. * @param len the number of characters to append. * @return this string buffer. */ public final FastStringBuffer append(char str[], int offset, int len) { int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(str, offset, value, count, len); count = newcount; return this; }
/** * Appends the string representation of the <code>char</code> array * argument to this string buffer. * <p> * The characters of the array argument are appended, in order, to * the contents of this string buffer. The length of this string * buffer increases by the length of the argument. * * @param str the characters to be appended. * @return this string buffer. */ public final FastStringBuffer append(char str[]) { int len = str.length; int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(str, 0, value, count, len); count = newcount; return this; }
/** * */ public final FastStringBuffer append( String str, int srcBegin, int srcEnd ) { // Null value has a representation! if (str == null) { str = String.valueOf(str); } // Ensure that the buffer is sized enough int newcount = count + srcEnd-srcBegin; if (newcount > value.length) { expandCapacity(newcount); } // Copy the desired characters str.getChars(srcBegin, srcEnd, value, count); count = newcount; return this; }
/** * Appends the string representation of a subarray of the * <code>char</code> array argument to this string buffer. * <p> * Characters of the character array <code>str</code>, starting at * index <code>offset</code>, are appended, in order, to the contents * of this string buffer. The length of this string buffer increases * by the value of <code>len</code>. * * @param str the characters to be appended. * @param offset the index of the first character to append. * @param len the number of characters to append. * @return this string buffer. */ public final FastStringBuffer append(char str[], int offset, int len) { int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(str, offset, value, count, len); count = newcount; return this; }
/** * Inserts the string representation of the <code>char</code> * argument into this string buffer. * <p> * The second argument is inserted into the contents of this string * buffer at the position indicated by <code>offset</code>. The length * of this string buffer increases by one. * <p> * The offset argument must be greater than or equal to * <code>0</code>, and less than or equal to the length of this * string buffer. * * @param offset the offset. * @param ch a <code>char</code>. * @return this string buffer. * @exception StringIndexOutOfBoundsException if the offset is invalid. */ public final FastStringBuffer insert(int offset, char c) { int newcount = count + 1; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = c; count = newcount; return this; }
/** * */ public final FastStringBuffer append( String str, int srcBegin, int srcEnd ) { // Null value has a representation! if (str == null) { str = String.valueOf(str); } // Ensure that the buffer is sized enough int newcount = count + srcEnd-srcBegin; if (newcount > value.length) { expandCapacity(newcount); } // Copy the desired characters str.getChars(srcBegin, srcEnd, value, count); count = newcount; return this; }
/** * Inserts the string representation of the <code>char</code> * argument into this string buffer. * <p> * The second argument is inserted into the contents of this string * buffer at the position indicated by <code>offset</code>. The length * of this string buffer increases by one. * <p> * The offset argument must be greater than or equal to * <code>0</code>, and less than or equal to the length of this * string buffer. * * @param offset the offset. * @param ch a <code>char</code>. * @return this string buffer. * @exception StringIndexOutOfBoundsException if the offset is invalid. */ public final FastStringBuffer insert(int offset, char c) { int newcount = count + 1; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = c; count = newcount; return this; }
/** * Appends the string to this string buffer. * <p> * The characters of the <code>String</code> argument are appended, in * order, to the contents of this string buffer, increasing the * length of this string buffer by the length of the argument. * * @param str a string. * @return this string buffer. */ public final FastStringBuffer append(String str) { if (str == null) { str = String.valueOf(str); } int len = str.length(); int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } str.getChars(0, len, value, count); count = newcount; return this; }
/** * Appends the string to this string buffer. * <p> * The characters of the <code>String</code> argument are appended, in * order, to the contents of this string buffer, increasing the * length of this string buffer by the length of the argument. * * @param str a string. * @return this string buffer. */ public final FastStringBuffer append(String str) { if (str == null) { str = String.valueOf(str); } int len = str.length(); int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } str.getChars(0, len, value, count); count = newcount; return this; }
/** * */ public final FastStringBuffer append( FastStringBuffer b, int srcBegin, int srcEnd ) { if (b == null) { return this; } if( srcBegin>=srcEnd ) { return this; } // Ensure that the buffer is zied enough int newcount = count + srcEnd-srcBegin; if (newcount > value.length) { expandCapacity(newcount); } // Copy the desired characters b.getChars(srcBegin, srcEnd, value, count); count = newcount; return this; } public final FastStringBuffer append( FastStringBuffer b ) {
/** * */ public final FastStringBuffer append( FastStringBuffer b, int srcBegin, int srcEnd ) { if (b == null) { return this; } if( srcBegin>=srcEnd ) { return this; } // Ensure that the buffer is zied enough int newcount = count + srcEnd-srcBegin; if (newcount > value.length) { expandCapacity(newcount); } // Copy the desired characters b.getChars(srcBegin, srcEnd, value, count); count = newcount; return this; } public final FastStringBuffer append( FastStringBuffer b ) {
/** * Inserts the string representation of the <code>char</code> array * argument into this string buffer. * <p> * The characters of the array argument are inserted into the * contents of this string buffer at the position indicated by * <code>offset</code>. The length of this string buffer increases by * the length of the argument. * * @param offset the offset. * @param ch a character array. * @return this string buffer. * @exception StringIndexOutOfBoundsException if the offset is invalid. */ public final FastStringBuffer insert(int offset, char str[]) { /*#IF DEBUG*/ if ((offset < 0) || (offset > count)) { throw new StringIndexOutOfBoundsException(); } /*#ENDIF*/ int len = str.length; int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(value, offset, value, offset + len, count - offset); System.arraycopy(str, 0, value, offset, len); count = newcount; return this; }
int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount);
/** * Inserts the string representation of the <code>char</code> array * argument into this string buffer. * <p> * The characters of the array argument are inserted into the * contents of this string buffer at the position indicated by * <code>offset</code>. The length of this string buffer increases by * the length of the argument. * * @param offset the offset. * @param ch a character array. * @return this string buffer. * @exception StringIndexOutOfBoundsException if the offset is invalid. */ public final FastStringBuffer insert(int offset, char str[]) { /*#IF DEBUG*/ if ((offset < 0) || (offset > count)) { throw new StringIndexOutOfBoundsException(); } /*#ENDIF*/ int len = str.length; int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount); } System.arraycopy(value, offset, value, offset + len, count - offset); System.arraycopy(str, 0, value, offset, len); count = newcount; return this; }
int newcount = count + len; if (newcount > value.length) { expandCapacity(newcount);
int newcount = count + nextObject-pos; if (newcount > value.length) { expandCapacity(newcount);
int newcount = count + nextObject-pos; if (newcount > value.length) { expandCapacity(newcount);