do ÂściÂągnięcia ^ pdf ^ ebook ^ pobieranie ^ download
Podstrony
- Strona startowa
- LE Modesitt Recluce 12 Wellspring of Chaos (v1.5)
- Elizabeth Haydon Rhapsody 4 Requiem for the Sun
- Krentz Jayne Ann Wilcza harmonia
- 794. Roberts Nora Kuzyn z Bretanii Minikolekcja Nory Roberts7
- Anthology Cowboys Gay Erotic Tales
- Hemingway Ernest Mieć‡ i nie mieć‡
- Roszel_Renee_Po_co_te_klamstwa
- GRD0912.Lovelace_Merline_Bukiet_na_walentynki
- Fiedler Arkady Zwierzć™ta z lasu dziewiczego
- informatyka inkscape podstawowa obsluga programu krzysztof ciesla ebook
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- quentinho.opx.pl
[ Pobierz całość w formacie PDF ]
public String toUpperCase()
Returns a string with the same characters as the calling object string, but with all letter characters con-
verted to uppercase.
EXAMPLE:
After program executes String greeting = "Hi Mary!";
greeting.toUpperCase() returns "HI MARY!".
5640_apx4.fm Page 1027 Tuesday, February 10, 2004 4:19 PM
Summary of Classes and Interfaces 1027
public String trim()
Returns a string with the same characters as the calling object string, but with leading and trailing white
space removed. Whitespace characters are the characters that print as white space on paper, such as the
blank (space) character, the tab character, and the new-line character '\n'.
EXAMPLE:
After program executes String pause = " Hmm ";
pause.trim() returns "Hmm".
StringBuffer
Package: java.lang
StringBuffer is marked final and so you cannot use it as a base class to derive another class.
Implements Interfaces: CharSequence, Serializable
Ancestor classes:
Object
|
+ StringBuffer
CONSTRUCTORS
public StringBuffer()
Creates a StringBuffer object with no characters in it and an initial capacity of 16 characters.
public StringBuffer(int capacity)
Constructs a StringBuffer object with no characters in it and an initial capacity specified by the argu-
ment.
Throws:
NegativeArraySizeException if length is less than 0. NegativeArraySizeException is a
derived class of RuntimeException, and so is an unchecked exception, which means it is not required to
be caught or declared in a throws clause.
public StringBuffer(String ordinaryString)
Constructs a string buffer so that it represents the same sequence of characters as the ordinaryString
argument; in other words, the initial content of the string buffer is a copy of ordinaryString. The initial
capacity of the string buffer is 16 plus the length of ordinaryString.
Throws:
NullPointerException if ordinaryString is null.
5640_apx4.fm Page 1028 Tuesday, February 10, 2004 4:19 PM
1028 Appendix 4 Summary of Classes and Interfaces
METHODS
public StringBuffer append(char[] charArray,
int offset, int length)
Appends the string representation of the characters in charArray starting at charArray[offset] and
extending for a total of length characters. Note that the calling object is changed and a reference to the
changed calling object is returned.
Throws:
ArrayIndexOutOfBoundsException if offset and length are not consistent with the range of
charArray.
public StringBuffer append(char c)
Appends the character argument to the StringBuffer calling object and returns this longer string.
public StringBuffer append(char[] charArray)
Appends the string representation of the char array argument to this string buffer. Note that the calling
object is changed and a reference to the changed calling object is returned.
public StringBuffer append(double d)
Appends the string representation of the double argument to the StringBuffer calling object and
returns this longer string.
public StringBuffer append(float d)
Appends the string representation of the float argument to the StringBuffer calling object and
returns this longer string.
public StringBuffer append(int n)
Appends the string representation of the int argument to the StringBuffer calling object and returns
this longer string.
public StringBuffer append(long n)
Appends the string representation of the long argument to the StringBuffer calling object and returns
this longer string.
public StringBuffer append(String ordinaryString)
Appends the String argument to the StringBuffer calling object and returns this longer string.
If ordinaryString is null, then the four characters "null" are appended to this string buffer.
Note that the calling object is changed and a reference to the changed calling object is returned.
public StringBuffer append(StringBuffer bufferedString)
Appends the StringBuffer argument to the StringBuffer calling object and returns this longer
string.
If bufferedString is null, then the four characters "null" are appended to this string buffer.
Note that the calling object is changed and a reference to the changed calling object is returned.
5640_apx4.fm Page 1029 Tuesday, February 10, 2004 4:19 PM
Summary of Classes and Interfaces 1029
public int capacity()
Returns the current capacity of the calling object. The capacity is the amount of storage currently avail-
able for characters. The capacity will automatically be increased if necessary.
public char charAt(int position)
Returns the character in the calling object string at position. Positions are counted 0, 1, 2, etc.
Throws:
IndexOutOfBoundsException if position is negative or not less than the length of the calling object.
contentEquals
There is no such method for the class StringBuffer, but see the method contentEquals for the class
String.
public StringBuffer delete(int start, int end)
Removes the characters in a substring of the calling object. The substring to remove begins at the specified
start and extends to the character at index end - 1 or to the end of the calling object if no such character
exists. If start is equal to end, no changes are made. Note that the calling object is changed and a refer-
ence to the changed calling object is returned.
Throws:
StringIndexOutOfBoundsException if start is negative, greater than length(), or greater than
[ Pobierz całość w formacie PDF ]