public final class LargeStringBuffer extends Object implements CharSequence, Serializable
Constructor and Description |
---|
LargeStringBuffer()
Create an empty LargeStringBuffer with default space allocation
|
LargeStringBuffer(int minAllocation,
int maxAllocation)
Create an empty LargeStringBuffer
|
Modifier and Type | Method and Description |
---|---|
void |
append(CharSequence data)
Append a CharSequence to this LargeStringBuffer
|
char |
charAt(int index)
Returns the character at the specified index.
|
boolean |
equals(Object other)
Compare equality
|
int |
hashCode()
Generate a hash code
|
int |
length()
Returns the length of this character sequence.
|
CharSequence |
subSequence(int start,
int end)
Returns a new character sequence that is a subsequence of this sequence.
|
String |
substring(int start,
int end)
Returns a new character sequence that is a subsequence of this sequence.
|
String |
toString()
Convert to a string
|
void |
write(Writer writer)
Write the value to a writer
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
chars, codePoints
public LargeStringBuffer()
public LargeStringBuffer(int minAllocation, int maxAllocation)
minAllocation
- initial allocation size for each segment (including the first)maxAllocation
- maximum allocation size for each segment. When a segment reaches this
size, a new segment is created rather than appending more characters to the existing segment.public void append(CharSequence data)
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
index
- the index of the character to be returnedIndexOutOfBoundsException
- if the index argument is negative or not less than
length()public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
start
- the start index, inclusiveend
- the end index, exclusiveIndexOutOfBoundsException
- if start or end are negative,
if end is greater than length(),
or if start is greater than endpublic String toString()
toString
in interface CharSequence
toString
in class Object
public String substring(int start, int end)
public void write(Writer writer) throws IOException
IOException