|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.tree.tiny.LargeStringBuffer
public final class LargeStringBuffer
This is an implementation of the JDK 1.4 CharSequence interface: it implements a CharSequence as a list of arrays of characters (the individual arrays are known as segments). The segments have a fixed size of 65536 characters.
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 Summary | |
---|---|
LargeStringBuffer()
Create an empty LargeStringBuffer with default space allocation |
Method Summary | |
---|---|
void |
append(CharSequence s)
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. |
void |
setLength(int length)
Set the length. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LargeStringBuffer()
Method Detail |
---|
public void append(CharSequence s)
append
in interface AppendableCharSequence
s
- the data to be appendedpublic int length()
length
in interface CharSequence
public void setLength(int length)
setLength
in interface AppendableCharSequence
length
- the new lengthpublic char charAt(int index)
charAt
in interface CharSequence
index
- the index of the character to be returned
IndexOutOfBoundsException
- 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, exclusive
IndexOutOfBoundsException
- 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 boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public 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 included
public void write(Writer writer) throws IOException
writer
- the writer to which the value is to be written
IOException
- if an error occurs downstream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |