THE PACKAGE JAVA.LANG
java.lang.StringBuffer
20.13
20.13.6
public int capacity()
The current capacity of this
StringBuffer
object is returned.
20.13.7
public void ensureCapacity(int minimumCapacity)
If the current capacity of this
StringBuffer
object is less than the argument, then
a new internal buffer is created with greater capacity. The new capacity will be the
larger of:
the
minimumCapacity
argument
twice the old capacity, plus
2
If the
minimumCapacity
argument is nonpositive, this method takes no action
and simply returns.
20.13.8
public void setLength(int newLength)
throws IndexOutOfBoundsException
This string buffer is altered to represent a new character sequence whose length is
specified by the argument. For every nonnegative index
k
less than
newLength
,
the character at index
k
in the new character sequence is the same as the character
at index
k
in the old sequence if
k
is less than the length of the old character
sequence; otherwise, it is the null character
\u0000
. This method also calls the
ensureCapacity
method ( 20.13.7) with argument
newLength
.
If the argument is negative, an
IndexOutOfBoundsException
is thrown.
20.13.9
public char charAt(int index)
throws IndexOutOfBoundsException
The specified character of the sequence currently represented by the string buffer,
as indicated by the
index
argument, is returned. The first character of the
sequence is at index
0
, the next at index
1
, and so on, as for array indexing.
If the
index
argument is negative or not less than the current length
( 20.13.5) of the string buffer, an
IndexOutOfBoundsException
is thrown.
551
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved