public final class LargeTextBuffer
extends java.lang.Object
This is more efficient than a buffer backed by a contiguous array of characters in cases where the size is likely to grow very large, and where substring operations are rare. As used within the TinyTree, extraction of the string value of a node requires character copying only in the case where the value crosses segment boundaries.
Constructor and Description |
---|
LargeTextBuffer()
Create an empty LargeTextBuffer with default space allocation
|
Modifier and Type | Method and Description |
---|---|
void |
appendUnicodeString(UnicodeString chars)
Append a string to the contents of the LargeTextBuffer
|
void |
close() |
int |
length() |
void |
setLength(int newLength)
Set the length.
|
UnicodeString |
substring(int start,
int end)
Returns a new character sequence that is a subsequence of this sequence.
|
public LargeTextBuffer()
public void appendUnicodeString(UnicodeString chars)
chars
- the string to be addedpublic UnicodeString substring(int start, int end)
start
- the start index, inclusive (codepoints, not bytes)end
- the end index, exclusive (codepoints, not bytes)java.lang.IndexOutOfBoundsException
- if start or end are negative,
if end is greater than length(),
or if start is greater than endpublic void close()
public int length()
public void setLength(int newLength)
newLength
- the new lengthCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.