151 |
* |
* |
152 |
* @param seq the initializing <code>CharSequence</code> |
* @param seq the initializing <code>CharSequence</code> |
153 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
|
* @since 1.5 |
|
154 |
*/ |
*/ |
155 |
public StringBuilder(CharSequence seq) |
public StringBuilder(CharSequence seq) |
156 |
{ |
{ |
345 |
* @param stringBuffer the <code>StringBuilder</code> to convert and append |
* @param stringBuffer the <code>StringBuilder</code> to convert and append |
346 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
347 |
* @see #append(Object) |
* @see #append(Object) |
|
* @since 1.4 |
|
348 |
*/ |
*/ |
349 |
public StringBuilder append(StringBuffer stringBuffer) |
public StringBuilder append(StringBuffer stringBuffer) |
350 |
{ |
{ |
432 |
* |
* |
433 |
* @param seq the <code>CharSequence</code> providing the characters |
* @param seq the <code>CharSequence</code> providing the characters |
434 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
|
* @since 1.5 |
|
435 |
*/ |
*/ |
436 |
public StringBuilder append(CharSequence seq) |
public StringBuilder append(CharSequence seq) |
437 |
{ |
{ |
447 |
* @param start the starting index |
* @param start the starting index |
448 |
* @param end one past the final index |
* @param end one past the final index |
449 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
|
* @since 1.5 |
|
450 |
*/ |
*/ |
451 |
public StringBuilder append(CharSequence seq, int start, |
public StringBuilder append(CharSequence seq, int start, |
452 |
int end) |
int end) |
528 |
* @param end the index after the last character to delete |
* @param end the index after the last character to delete |
529 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
530 |
* @throws StringIndexOutOfBoundsException if start or end are out of bounds |
* @throws StringIndexOutOfBoundsException if start or end are out of bounds |
|
* @since 1.2 |
|
531 |
*/ |
*/ |
532 |
public StringBuilder delete(int start, int end) |
public StringBuilder delete(int start, int end) |
533 |
{ |
{ |
549 |
* @param index the index of the character to delete |
* @param index the index of the character to delete |
550 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
551 |
* @throws StringIndexOutOfBoundsException if index is out of bounds |
* @throws StringIndexOutOfBoundsException if index is out of bounds |
|
* @since 1.2 |
|
552 |
*/ |
*/ |
553 |
public StringBuilder deleteCharAt(int index) |
public StringBuilder deleteCharAt(int index) |
554 |
{ |
{ |
567 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
568 |
* @throws StringIndexOutOfBoundsException if start or end are out of bounds |
* @throws StringIndexOutOfBoundsException if start or end are out of bounds |
569 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
|
* @since 1.2 |
|
570 |
*/ |
*/ |
571 |
public StringBuilder replace(int start, int end, String str) |
public StringBuilder replace(int start, int end, String str) |
572 |
{ |
{ |
594 |
* @return new String which is a substring of this StringBuilder |
* @return new String which is a substring of this StringBuilder |
595 |
* @throws StringIndexOutOfBoundsException if beginIndex is out of bounds |
* @throws StringIndexOutOfBoundsException if beginIndex is out of bounds |
596 |
* @see #substring(int, int) |
* @see #substring(int, int) |
|
* @since 1.2 |
|
597 |
*/ |
*/ |
598 |
public String substring(int beginIndex) |
public String substring(int beginIndex) |
599 |
{ |
{ |
612 |
* @throws IndexOutOfBoundsException if beginIndex or endIndex is out of |
* @throws IndexOutOfBoundsException if beginIndex or endIndex is out of |
613 |
* bounds |
* bounds |
614 |
* @see #substring(int, int) |
* @see #substring(int, int) |
|
* @since 1.4 |
|
615 |
*/ |
*/ |
616 |
public CharSequence subSequence(int beginIndex, int endIndex) |
public CharSequence subSequence(int beginIndex, int endIndex) |
617 |
{ |
{ |
627 |
* @return new String which is a substring of this StringBuilder |
* @return new String which is a substring of this StringBuilder |
628 |
* @throws StringIndexOutOfBoundsException if beginIndex or endIndex is out |
* @throws StringIndexOutOfBoundsException if beginIndex or endIndex is out |
629 |
* of bounds |
* of bounds |
|
* @since 1.2 |
|
630 |
*/ |
*/ |
631 |
public String substring(int beginIndex, int endIndex) |
public String substring(int beginIndex, int endIndex) |
632 |
{ |
{ |
649 |
* @return this <code>StringBuilder</code> |
* @return this <code>StringBuilder</code> |
650 |
* @throws NullPointerException if <code>str</code> is <code>null</code> |
* @throws NullPointerException if <code>str</code> is <code>null</code> |
651 |
* @throws StringIndexOutOfBoundsException if any index is out of bounds |
* @throws StringIndexOutOfBoundsException if any index is out of bounds |
|
* @since 1.2 |
|
652 |
*/ |
*/ |
653 |
public StringBuilder insert(int offset, |
public StringBuilder insert(int offset, |
654 |
char[] str, int str_offset, int len) |
char[] str, int str_offset, int len) |
825 |
* @return location (base 0) of the String, or -1 if not found |
* @return location (base 0) of the String, or -1 if not found |
826 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
827 |
* @see #indexOf(String, int) |
* @see #indexOf(String, int) |
|
* @since 1.4 |
|
828 |
*/ |
*/ |
829 |
public int indexOf(String str) |
public int indexOf(String str) |
830 |
{ |
{ |
841 |
* @param fromIndex index to start the search |
* @param fromIndex index to start the search |
842 |
* @return location (base 0) of the String, or -1 if not found |
* @return location (base 0) of the String, or -1 if not found |
843 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
|
* @since 1.4 |
|
844 |
*/ |
*/ |
845 |
public int indexOf(String str, int fromIndex) |
public int indexOf(String str, int fromIndex) |
846 |
{ |
{ |
860 |
* @return location (base 0) of the String, or -1 if not found |
* @return location (base 0) of the String, or -1 if not found |
861 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
862 |
* @see #lastIndexOf(String, int) |
* @see #lastIndexOf(String, int) |
|
* @since 1.4 |
|
863 |
*/ |
*/ |
864 |
public int lastIndexOf(String str) |
public int lastIndexOf(String str) |
865 |
{ |
{ |
876 |
* @param fromIndex index to start the search |
* @param fromIndex index to start the search |
877 |
* @return location (base 0) of the String, or -1 if not found |
* @return location (base 0) of the String, or -1 if not found |
878 |
* @throws NullPointerException if str is null |
* @throws NullPointerException if str is null |
|
* @since 1.4 |
|
879 |
*/ |
*/ |
880 |
public int lastIndexOf(String str, int fromIndex) |
public int lastIndexOf(String str, int fromIndex) |
881 |
{ |
{ |