|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.FrameworkSupertype
coldbox.system.Plugin
coldbox.system.plugins.StringBuffer
public class StringBuffer
This CFC greatly increases the speed of string concatenation. CF strings are immutable. When you append a string to another string, a whole new string is created. This is fine for a small number of iterations but painfully slow and memory intensive for a large number of concatenation operations. This plugin switches between StringBuilder and StringBuffer if running under cf8
| Constructor Summary | |
|---|---|
init(any controller)
|
|
| Method Summary | |
|---|---|
void |
append([string strIn=''])
Append a string to the buffer |
numeric |
capacity()
Returns the current capacity of the String buffer |
void |
delete(numeric startPos, numeric endPos)
Removes the characters in a substring of this StringBuffer |
string |
getString()
Converts to a string representing the data in this string buffer |
any |
getStringBuffer()
Return the StringBuffer Java Object |
numeric |
indexOf(string inStr, [numeric fromPos='0'])
Returns the index within this string of the first occurrence of the specified substring |
void |
insertStr([numeric offSet='0'], string inStr)
Inserts the string into this string buffer at an offset |
numeric |
lastIndexOf(string inStr, [numeric fromPos='0'])
Returns the index within this string of the last occurrence of the specified substring |
numeric |
length()
Returns the length (character count) of this string buffer |
void |
replaceStr(numeric startPos, numeric endPos, string inStr)
Replaces the chracters in a substring of this StringBuffer with characters in the specified inStr |
void |
reverseStr()
The character sequence contained in this string buffer is replaced by the reverse of the sequence |
void |
setLength(numeric newLength)
Sets the length of this String buffer |
Plugin |
setup([string strIn=''], [numeric BufferLength='16'])
initializes the StringBuffer CF/java object |
string |
substring(numeric startPos, [numeric endPos='[runtime expression]'])
Returns a new String that contains a subsequence of characters currently contained in this StringBuffer |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(any controller)
controller| Method Detail |
|---|
public void append([string strIn=''])
strIn - a string to append to the bufferpublic numeric capacity()
public void delete(numeric startPos, numeric endPos)
startPos - The beginning index, inclusive.endPos - The ending index, exclusive.public string getString()
public any getStringBuffer()
public numeric indexOf(string inStr, [numeric fromPos='0'])
inStr - the substring for which to searchfromPos - the index from which to start the searchpublic void insertStr([numeric offSet='0'], string inStr)
offSet - the offsetinStr - a stringpublic numeric lastIndexOf(string inStr, [numeric fromPos='0'])
inStr - the substring for which to searchfromPos - the index from which to start the searchpublic numeric length()
public void replaceStr(numeric startPos, numeric endPos, string inStr)
startPos - The beginning index, inclusive.endPos - The ending index, exclusive.inStr - a stringpublic void reverseStr()
public void setLength(numeric newLength)
newLength - Length in characters to set.public Plugin setup([string strIn=''], [numeric BufferLength='16'])
strIn - A string to initialize the buffer with. The bufferLength will be the number of characters + 16. This argument is mutually exclusive to BufferLengthBufferLength - The length to start the buffer at. The default is 16 characters. This argument is mutually exclusive to strIn public string substring(numeric startPos, [numeric endPos='[runtime expression]'])
startPos - The beginning index, inclusive.endPos - The ending index, exclusive.
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||