| java.lang.Object workbench.util.StrBuffer
StrBuffer | public class StrBuffer implements CharSequence(Code) | | This is a non-synchronized implementation of StringBuffer, which
offers better performance than the class java.lang.StringBuffer.
Initially copied from http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2488,00.html
This will only have an advantage if this object is not converted to a String object
too often. java.lang.StringBuilder can re-use the internal char[] array when
it's toString() method is called, whereas StrBuffer.toString() will allocate
a new char array due to the constructor of String.
So StrBuffer is most efficient when it is never converted to a String object.
For this, methods to write to a Stream and a Writer are provided that
write out the internal char array directly.
author: support@sql-workbench.net See Also: java.lang.StringBuilder |
StrBuffer | public StrBuffer()(Code) | | Make an empty string buffer with 80 characters of storage.
|
StrBuffer | public StrBuffer(int len)(Code) | | Make an empty string buffer with 'len' characters of storage.
Parameters: len - the initial storage capacity. exception: NegativeArraySizeException - if the 'len' less than 0. |
append | public StrBuffer append(char c)(Code) | | Appends the character to this StrBuffer.
Parameters: c - the character to append this string buffer |
charAt | public char charAt(int index)(Code) | | |
endsWith | public boolean endsWith(char c)(Code) | | |
getBuffer | public char[] getBuffer()(Code) | | This is exposed, so that the StrBuffer
can be used when writing to a Writer without
the need to copy the char[] array
|
length | public int length()(Code) | | Returns the current length of this StrBuffer
|
removeFromEnd | public StrBuffer removeFromEnd(int count)(Code) | | Remove count characters from the end of the buffer
|
rtrim | public void rtrim()(Code) | | |
toString | public String toString()(Code) | | Returns a new string based on the contents of this StrBuffer.
a string |
|
|