public class XMLStringBuffer extends XMLString
XMLString is a structure used to pass character arrays. However, XMLStringBuffer is a buffer in which characters can be appended and extends XMLString so that it can be passed to methods expecting an XMLString object. This is a safe operation because it is assumed that any callee will not modify the contents of the XMLString structure.
The contents of the string are managed by the string buffer. As characters are appended, the string buffer will grow as needed.
Note: Never set the ch
,
offset
, and length
fields directly.
These fields are managed by the string buffer. In order to reset
the buffer, call clear()
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE
Default buffer size (32).
|
Constructor and Description |
---|
XMLStringBuffer() |
XMLStringBuffer(char c)
Constructs a string buffer from a char.
|
XMLStringBuffer(char[] ch,
int offset,
int length)
Constructs a string buffer from the specified character array.
|
XMLStringBuffer(int size) |
XMLStringBuffer(String s)
Constructs a string buffer from a String.
|
XMLStringBuffer(XMLString s)
Constructs a string buffer from the specified XMLString.
|
Modifier and Type | Method and Description |
---|---|
void |
append(char c)
append
|
void |
append(char[] ch,
int offset,
int length)
append
|
void |
append(String s)
append
|
void |
append(XMLString s)
append
|
void |
clear()
Clears the string buffer.
|
public static final int DEFAULT_SIZE
public XMLStringBuffer()
public XMLStringBuffer(int size)
size
- sizepublic XMLStringBuffer(char c)
c
- characterpublic XMLStringBuffer(String s)
s
- stringpublic XMLStringBuffer(char[] ch, int offset, int length)
ch
- char arrayoffset
- offsetlength
- lengthpublic XMLStringBuffer(XMLString s)
s
- xml stringpublic void append(char c)
c
- charpublic void append(String s)
s
- stringpublic void append(char[] ch, int offset, int length)
ch
- char arryoffset
- offsetlength
- lengthpublic void append(XMLString s)
s
- xml stringCopyright © 2000–2020 Apache Software Foundation. All rights reserved.