|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--calypso.util.StringBuf
This class is similar to java/lang/StringBuffer with the following changes:
| Constructor Summary | |
StringBuf()
Constructs an empty String buffer. |
|
StringBuf(char[] chars,
int offset,
int length)
|
|
StringBuf(int length)
Constructs an empty String buffer with the specified initial length. |
|
StringBuf(java.lang.String str)
Constructs a String buffer with the specified initial value. |
|
| Method Summary | |
static StringBuf |
Alloc()
Constructs an empty String buffer, reusing one from the recycler. |
StringBuf |
append(boolean b)
Appends a boolean to the end of this buffer. |
StringBuf |
append(char c)
Appends a character to the end of this buffer. |
StringBuf |
append(char[] str)
Appends an array of characters to the end of this buffer. |
StringBuf |
append(char[] str,
int offset,
int len)
Appends a part of an array of characters to the end of this buffer. |
StringBuf |
append(double d)
Appends a double to the end of this buffer. |
StringBuf |
append(float f)
Appends a float to the end of this buffer. |
StringBuf |
append(int i)
Appends an integer to the end of this buffer. |
StringBuf |
append(long l)
Appends a long to the end of this buffer. |
StringBuf |
append(java.lang.Object obj)
Appends an object to the end of this buffer. |
StringBuf |
append(java.lang.String str)
Appends a String to the end of this buffer. |
StringBuf |
assign(char[] str)
|
StringBuf |
assign(char[] str,
int offset,
int len)
|
StringBuf |
assign(java.lang.String str)
|
int |
capacity()
Returns the current capacity of the String buffer. |
char |
charAt(int index)
Returns the character at the specified index. |
void |
compressWhitespace(boolean aStripLeadingWhitespace)
Compress the whitespace present in the buffer. |
static void |
EmptyRecycler()
Empty the recycler discarding any cached StringBuf objects |
void |
ensureCapacity(int minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum. |
boolean |
equals(java.lang.Object aObject)
|
boolean |
equals(java.lang.String anotherString)
Compares this StringBuf to another String. |
boolean |
equals(StringBuf anotherString)
Compares this StringBuf to another StringBuf. |
boolean |
equalsIgnoreCase(int aStart,
int aLength,
java.lang.String anotherString)
|
boolean |
equalsIgnoreCase(java.lang.String anotherString)
Compares this StringBuf to another String. |
boolean |
equalsIgnoreCase(StringBuf anotherString)
Compares this StringBuf to another StringBuf. |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
Copies the characters of the specified substring (determined by srcBegin and srcEnd) into the character array, starting at the array's dstBegin location. |
int |
indexOf(int ch)
|
int |
indexOf(int ch,
int fromIndex)
|
StringBuf |
insert(int offset,
boolean b)
Inserts a boolean into the String buffer. |
StringBuf |
insert(int offset,
char c)
Inserts a character into the String buffer. |
StringBuf |
insert(int offset,
char[] str)
Inserts an array of characters into the String buffer. |
StringBuf |
insert(int offset,
double d)
Inserts a double into the String buffer. |
StringBuf |
insert(int offset,
float f)
Inserts a float into the String buffer. |
StringBuf |
insert(int offset,
int i)
Inserts an integer into the String buffer. |
StringBuf |
insert(int offset,
long l)
Inserts a long into the String buffer. |
StringBuf |
insert(int offset,
java.lang.Object obj)
Inserts an object into the String buffer. |
StringBuf |
insert(int offset,
java.lang.String str)
Inserts a String into the String buffer. |
boolean |
isWhitespace()
Return true if the string buffer contains nothing but whitespace as defined by Character.isWhitespace() |
int |
length()
Returns the length (character count) of the buffer. |
static void |
Recycle(StringBuf aBuf)
Release a StringBuf to the recycler. |
void |
remove(int fromIndex)
|
void |
remove(int fromIndex,
int toIndex)
Remove characters from the StringBuf starting at fromIndex and up to but not including toIndex. |
StringBuf |
reverse()
Reverse the order of the characters in the String buffer. |
void |
setCharAt(int index,
char ch)
Changes the character at the specified index to be ch. |
void |
setEmpty()
Clear the content for reuse. |
void |
setLength(int newLength)
Sets the length of the String. |
char[] |
toChars()
|
void |
toLowerCase()
|
java.lang.String |
toString()
Converts to a String representing the data in the buffer. |
void |
toUpperCase()
|
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public StringBuf()
public StringBuf(int length)
length - the initial lengthpublic StringBuf(java.lang.String str)
str - the initial value of the buffer
public StringBuf(char[] chars,
int offset,
int length)
| Method Detail |
public static StringBuf Alloc()
public static void Recycle(StringBuf aBuf)
public static void EmptyRecycler()
public int length()
public int capacity()
public void ensureCapacity(int minimumCapacity)
minimumCapacity - the minimum desired capacitypublic void setLength(int newLength)
newLength - the new length of the bufferpublic void setEmpty()
public char charAt(int index)
index - the index of the desired character
public void getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
srcBegin - begin copy at this offset in the StringsrcEnd - stop copying at this offset in the Stringdst - the array to copy the data intodstBegin - offset into dst
public void setCharAt(int index,
char ch)
index - the index of the characterch - the new characterpublic StringBuf append(java.lang.Object obj)
obj - the object to be appendedpublic StringBuf append(java.lang.String str)
str - the String to be appendedpublic StringBuf append(char[] str)
str - the characters to be appendedpublic StringBuf assign(char[] str)
public StringBuf assign(java.lang.String str)
public StringBuf assign(char[] str,
int offset,
int len)
public StringBuf append(char[] str,
int offset,
int len)
str - the characters to be appendedoffset - where to startlen - the number of characters to addpublic StringBuf append(boolean b)
b - the boolean to be appendedpublic StringBuf append(char c)
ch - the character to be appendedpublic StringBuf append(int i)
i - the integer to be appendedpublic StringBuf append(long l)
l - the long to be appendedpublic StringBuf append(float f)
f - the float to be appendedpublic StringBuf append(double d)
d - the double to be appended
public StringBuf insert(int offset,
java.lang.Object obj)
offset - the offset at which to insertobj - the object to insert
public StringBuf insert(int offset,
java.lang.String str)
offset - the offset at which to insertstr - the String to insert
public StringBuf insert(int offset,
char[] str)
offset - the offset at which to insertstr - the characters to insert
public StringBuf insert(int offset,
boolean b)
offset - the offset at which to insertb - the boolean to insert
public StringBuf insert(int offset,
char c)
offset - the offset at which to insertch - the character to insert
public StringBuf insert(int offset,
int i)
offset - the offset at which to inserti - the integer to insert
public StringBuf insert(int offset,
long l)
offset - the offset at which to insertl - the long to insert
public StringBuf insert(int offset,
float f)
offset - the offset at which to insertf - the float to insert
public StringBuf insert(int offset,
double d)
offset - the offset at which to insertd - the double to insertpublic StringBuf reverse()
public void toUpperCase()
public void toLowerCase()
public java.lang.String toString()
public char[] toChars()
public void compressWhitespace(boolean aStripLeadingWhitespace)
public boolean isWhitespace()
public boolean equalsIgnoreCase(java.lang.String anotherString)
anotherString - the String to compare this String against
public boolean equalsIgnoreCase(int aStart,
int aLength,
java.lang.String anotherString)
public boolean equalsIgnoreCase(StringBuf anotherString)
anotherString - the String to compare this String againstpublic boolean equals(java.lang.Object aObject)
public boolean equals(StringBuf anotherString)
anotherString - the String to compare this String againstpublic boolean equals(java.lang.String anotherString)
anotherString - the String to compare this String againstpublic int indexOf(int ch)
public int indexOf(int ch,
int fromIndex)
public void remove(int fromIndex)
public void remove(int fromIndex,
int toIndex)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||