public final class AutoString
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
AutoString()
Construct a new AutoString allocating a buffer of the default size.
|
AutoString(int initialSize)
Construct a new AutoString allocating a buffer of the specified size.
|
Modifier and Type | Method and Description |
---|---|
void |
append(AutoString buf)
Append to this buffer the contents of another AutoString.
|
void |
append(char ch)
Append one character to this string buffer.
|
void |
append(char[] cbuf,
int off,
int len)
Append a portion of an array of characters to this string buffer.
|
void |
append(java.lang.String str)
Append a string to this string buffer.
|
void |
append(java.lang.String str1,
java.lang.String str2)
Append a sequence of two strings to this string buffer.
|
void |
append(java.lang.String str1,
java.lang.String str2,
java.lang.String str3)
Append a sequence of three strings to this string buffer.
|
void |
append(java.lang.String str1,
java.lang.String str2,
java.lang.String str3,
java.lang.String str4)
Append a sequence of four strings to this string buffer.
|
void |
append(java.lang.String str1,
java.lang.String str2,
java.lang.String str3,
java.lang.String str4,
java.lang.String str5)
Append a sequence of five strings to this string buffer.
|
void |
appendBoolean(boolean b)
Append to this buffer the string representation of boolean.
|
void |
appendInt(int i)
Append to this buffer the string representation of an integer.
|
void |
clear()
Clear the characters from the buffer but keep the allocated space.
|
java.lang.Object |
clone()
Clones this AutoString.
|
boolean |
equals(java.lang.Object obj)
Return true if a specified Object is an AutoString and has exactly the same
contents as this AutoString.
|
int |
hashCode()
Return a hashcode for this AutoString.
|
int |
length()
Return the length (character count) of this string buffer.
|
java.lang.String |
toString()
Convert to a string representing the data in this string buffer.
|
public AutoString(int initialSize)
initialSize
- initial size of AutoStringpublic AutoString()
public void append(java.lang.String str)
str
- string to appendpublic void append(java.lang.String str1, java.lang.String str2)
str1
- first stringstr2
- seconds stringpublic void append(java.lang.String str1, java.lang.String str2, java.lang.String str3)
str1
- first stringstr2
- seconds stringstr3
- third stringpublic void append(java.lang.String str1, java.lang.String str2, java.lang.String str3, java.lang.String str4)
str1
- first stringstr2
- seconds stringstr3
- third stringstr4
- fourth stringpublic void append(java.lang.String str1, java.lang.String str2, java.lang.String str3, java.lang.String str4, java.lang.String str5)
str1
- first stringstr2
- seconds stringstr3
- third stringstr4
- fourth stringstr5
- fifth stringpublic void append(char[] cbuf, int off, int len)
cbuf
- array of characters to appendoff
- start positionlen
- number of characters from start (off)public void append(AutoString buf)
buf
- auto string to appendpublic void append(char ch)
ch
- character to appendpublic void appendInt(int i)
i
- integer to appendpublic void appendBoolean(boolean b)
b
- boolean to appendpublic void clear()
public int length()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- object to compare totrue
if the objects are equalpublic java.lang.Object clone()
clone
in class java.lang.Object