| java.lang.Object com.versant.core.util.CharBuf
CharBuf | final public class CharBuf (Code) | | Fast StringBuffer replacement that allows direct access to the underlying
char[]. This is based com.sosnoski.util.array.CharArray from
Sosnoski Software Solutions, Inc.
|
Method Summary | |
protected void | adjust(int from, int to, int length) Adjust the characters in the array to make room for an insertion or
replacement. | public int | append(char ch) Append ch and return its index. | public int | append(int i) Append i and return its index. | public int | append(String s) Append s and return its index. | public int | append(char[] a) Append a and return its index. | public void | clear() | public void | insert(int offset, char[] text) Insert the characters from a char[] into the array. | public void | insert(int offset, String text) Insert the characters from a String into the array. | public void | remove(int from, int to) Remove a range of value from the array. | public void | replace(int i, char[] text) Replace characters from i onwards with supplied characters. | public void | replace(int first, int last, char c) Replace characters from first to last - 1 with c. | public void | replace(int from, int to, String text) Replace a character range in the array with the characters from a
String . | public void | replace(int from, int to, char[] text) Replace a character range in the array with the characters from a
char[] . | public void | set(int index, char value) Set the value at an index position in the array. | public void | setSize(int sz) | public int | size() | public char[] | toArray(int offset, int length) Constructs and returns a simple array containing the same data as held
in a portion of this growable array. | public String | toString() | public String | toString(int offset, int length) Construct a String from a portion of the character sequence
present. |
CharBuf | public CharBuf(int capacity)(Code) | | |
adjust | protected void adjust(int from, int to, int length)(Code) | | Adjust the characters in the array to make room for an insertion or
replacement. Depending on the relative sizes of the range being
replaced and the range being inserted, this may move characters past
the start of the replacement range up or down in the array.
Parameters: from - index number of first character to be replaced Parameters: to - index number past last character to be replaced Parameters: length - length of character range being inserted |
append | public int append(char ch)(Code) | | Append ch and return its index.
|
append | public int append(int i)(Code) | | Append i and return its index.
|
append | public int append(String s)(Code) | | Append s and return its index.
|
append | public int append(char[] a)(Code) | | Append a and return its index.
|
clear | public void clear()(Code) | | |
insert | public void insert(int offset, char[] text)(Code) | | Insert the characters from a char[] into the array.
|
insert | public void insert(int offset, String text)(Code) | | Insert the characters from a String into the array.
|
remove | public void remove(int from, int to)(Code) | | Remove a range of value from the array. The index positions for values
above the range removed are decreased by the number of values removed.
Parameters: from - index number of first value to be removed Parameters: to - index number past last value to be removed |
replace | public void replace(int i, char[] text)(Code) | | Replace characters from i onwards with supplied characters. This does
not do any error checking or make any attempt to expand the buffer
for performance reasons.
|
replace | public void replace(int first, int last, char c)(Code) | | Replace characters from first to last - 1 with c. This does
not do any error checking for performance reasons.
|
replace | public void replace(int from, int to, String text)(Code) | | Replace a character range in the array with the characters from a
String .
|
replace | public void replace(int from, int to, char[] text)(Code) | | Replace a character range in the array with the characters from a
char[] .
|
set | public void set(int index, char value)(Code) | | Set the value at an index position in the array.
|
setSize | public void setSize(int sz)(Code) | | |
toArray | public char[] toArray(int offset, int length)(Code) | | Constructs and returns a simple array containing the same data as held
in a portion of this growable array.
|
toString | public String toString(int offset, int length)(Code) | | Construct a String from a portion of the character sequence
present.
|
|
|