java.io.Serializable, java.lang.CharSequencepublic final class LargeStringBuffer
extends java.lang.Object
implements java.lang.CharSequence, java.io.Serializable
| Constructor | Description |
|---|---|
LargeStringBuffer() |
Create an empty LargeStringBuffer with default space allocation
|
LargeStringBuffer(int minAllocation,
int maxAllocation) |
Create an empty LargeStringBuffer
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
append(java.lang.CharSequence data) |
Append a CharSequence to this LargeStringBuffer
|
char |
charAt(int index) |
Returns the character at the specified index.
|
void |
dumpDataStructure() |
Produce diagnostic dump
|
boolean |
equals(java.lang.Object other) |
Compare equality
|
int |
hashCode() |
Generate a hash code
|
int |
length() |
Returns the length of this character sequence.
|
java.lang.CharSequence |
subSequence(int start,
int end) |
Returns a new character sequence that is a subsequence of this sequence.
|
java.lang.String |
substring(int start,
int end) |
Returns a new character sequence that is a subsequence of this sequence.
|
java.lang.String |
toString() |
Convert to a string
|
void |
write(java.io.Writer writer) |
Write the value to a writer
|
public LargeStringBuffer()
public LargeStringBuffer(int minAllocation,
int maxAllocation)
minAllocation - initial allocation size for each segment (including the first). If minAllocation
exceeds maxAllocation, it is rounded down to the value of maxAllocationmaxAllocation - 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.
However, a segment may have size greater than maxAllocation if the data is appended in a single chunk
of size maxAllocation.public void append(java.lang.CharSequence data)
data - the data to be appendedpublic int length()
length in interface java.lang.CharSequencepublic char charAt(int index)
charAt in interface java.lang.CharSequenceindex - the index of the character to be returnedjava.lang.IndexOutOfBoundsException - if the index argument is negative or not less than
length()public java.lang.CharSequence subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencestart - the start index, inclusiveend - the end index, exclusivejava.lang.IndexOutOfBoundsException - if start or end are negative,
if end is greater than length(),
or if start is greater than endpublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String substring(int start,
int end)
start - index of the first character to be includedend - index of the character after the last one to be includedpublic void write(java.io.Writer writer)
throws java.io.IOException
writer - the writer to which the value is to be writtenjava.io.IOExceptionpublic void dumpDataStructure()