ReplaceableString is an adapter class that implements the
Replaceable API around an ordinary StringBuffer.Note
This class does not support attributes and is not
intended for general use. Most clients will need to implement
Replaceable in their text representation class.
Copyright © IBM Corporation 1999. All rights reserved.
Replaceable
| Modifier and Type | Field and Description |
|---|---|
| private StringBuffer |
| Access | Constructor and Description |
|---|---|
| public | ReplaceableString(String
initial contents str)Construct a new object with the given initial contents. |
| public | ReplaceableString(StringBuffer
object to be used as internal storage buf)Construct a new object using |
| Modifier and Type | Method and Description |
|---|---|
| public char | charAt(int
offset into the contents, from 0 to
offset)length() - 1Implements jdk. Return the character at the given position in this object. |
| public void | getChars(int
the beginning index to copy, inclusive;
srcStart, int 0 <= start <= limit.the ending index to copy, exclusive;
srcLimit, char[] start <= limit <= length().the destination array. dst, int the start offset in the destination array. dstStart)Implements jdk. Copies characters from this object into the destination character array. |
| public int | length()
Implements jdk. Return the number of characters contained in this object. |
| buf | back to summary |
|---|---|
| private StringBuffer buf | |
| ReplaceableString | back to summary |
|---|---|
| public ReplaceableString(String str) Construct a new object with the given initial contents. | |
| ReplaceableString | back to summary |
|---|---|
| public ReplaceableString(StringBuffer buf) Construct a new object using Note Modifications to
| |
| charAt | back to summary |
|---|---|
| public char charAt(int offset) Implements jdk. Return the character at the given position in this object.
| |
| getChars | back to summary |
|---|---|
| public void getChars(int srcStart, int srcLimit, char[] dst, int dstStart) Implements jdk. Copies characters from this object into the destination
character array. The first character to be copied is at index
| |
| length | back to summary |
|---|---|
| public int length() Implements jdk. Return the number of characters contained in this object.
| |