|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.string.CharBuffer
public class CharBuffer
Class which stores text in a char array buffer and
allows inserting, deleting, removing, appending etc. actions
with the stored text.
| Constructor Summary | |
|---|---|
CharBuffer()
Constructs an object of this class. |
|
CharBuffer(int length)
Constructs an object of this class with specified length of buffer. |
|
| Method Summary | |
|---|---|
void |
append(char c)
Appends a char at the end of this buffer. |
void |
append(char[] str)
Appends a char array at the end of this class one. |
void |
append(char[] str,
int offset,
int len)
|
void |
append(java.lang.String str)
Appends a string at the end of this buffer. |
char |
charAt(int index)
Returns a char at a specified index of this buffer. |
void |
ensureCapacity(int minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum. |
boolean |
equals(int offset,
java.lang.String with)
|
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
|
char[] |
getValue()
Returns text as a char array. |
int |
length()
Returns the length of this char buffer. |
void |
setCharAt(int index,
char ch)
Replaces a char in specified index in the buffer with another one. |
void |
setLength(int newLength)
Sets a new length to this buffer. |
java.lang.String |
substring(int start,
int end)
Returns substring from this buffer. |
java.lang.String |
toString()
Makes a string representation of this buffer. |
java.lang.String |
trim()
Removes white space from both ends of this string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CharBuffer()
public CharBuffer(int length)
length - initial lenght of the char array| Method Detail |
|---|
public int length()
public void ensureCapacity(int minimumCapacity)
minimumCapacity - minimum value of the capacitypublic void setLength(int newLength)
newLength - the new lengthpublic char charAt(int index)
char at a specified index of this buffer.
index - the index of the searched char
char.
public void setCharAt(int index,
char ch)
index - the index of the searched charch - the specified charpublic void append(java.lang.String str)
str - the string to be appended
public void append(char[] str,
int offset,
int len)
public void append(char[] str)
str - the array to be appendedpublic void append(char c)
c - the char to be appended
public java.lang.String substring(int start,
int end)
start - from where to startend - where to end
public java.lang.String trim()
If this String object represents an empty character
sequence, or the first and last characters of character sequence
represented by this String object both have codes
greater than '\u0020' (the space character), then a
reference to this String object is returned.
Otherwise, if there is no character with a code greater than
'\u0020' in the string, then a new
String object representing an empty string is created
and returned.
Otherwise, let k be the index of the first character in the
string whose code is greater than '\u0020', and let
m be the index of the last character in the string whose code
is greater than '\u0020'. A new String
object is created, representing the substring of this string that
begins with the character at index k and ends with the
character at index m-that is, the result of
this.substring(k, m+1).
This method may be used to trim
whitespace from the beginning and end
of a string; in fact, it trims all ASCII control characters as well.
public boolean equals(int offset,
java.lang.String with)
public void getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
public java.lang.String toString()
toString in class java.lang.Objectpublic char[] getValue()
char array.
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||