@Deprecated
public class StringBuilderDelimited
extends java.lang.Object
implements java.lang.Appendable, java.lang.CharSequence
Does not extend StringBuilder because that would probably break, due to the possibility of calling the wrong version of append. Also, I don't (yet) want to override all the methods; this simpler version seems sufficient for the time being.
Obsoleted by the Java 8 StringJoiner class. Use only if your code must compile or run under Java 7.
Constructor and Description |
---|
StringBuilderDelimited(java.lang.String delimiter)
Deprecated.
Create a new StringBuilderDelimited.
|
Modifier and Type | Method and Description |
---|---|
StringBuilderDelimited |
add(java.lang.CharSequence newElement)
Deprecated.
|
StringBuilderDelimited |
append(char c)
Deprecated.
Use
add(CharSequence) ; change sbd.append(c) into sbd.add(c.toString()) |
StringBuilderDelimited |
append(java.lang.CharSequence csq)
Deprecated.
Use
add(CharSequence) ; change sbd.append(csq) into sbd.add(csq) |
StringBuilderDelimited |
append(java.lang.CharSequence csq,
int start,
int end)
Deprecated.
Use
add(CharSequence) ; change sbd.append(csq, start, end) into
sbd.add(csq.subSequence(start, end) |
StringBuilderDelimited |
append(java.lang.Object o)
Deprecated.
Use
add(CharSequence) ; change sbd.append(o) into sbd.add(o.toString()) |
StringBuilderDelimited |
append(java.lang.String str)
Deprecated.
Use
add(CharSequence) ; change sbd.append(str) into sbd.add(str) |
char |
charAt(int index)
Deprecated.
Not supported by StringJoiner which will supersede this
|
int |
length()
Deprecated.
|
java.lang.CharSequence |
subSequence(int start,
int end)
Deprecated.
Not supported by StringJoiner which will supersede this
|
java.lang.String |
toString()
Deprecated.
|
public StringBuilderDelimited(java.lang.String delimiter)
delimiter
- the delimiter to be put between strings that are appended to thispublic StringBuilderDelimited add(java.lang.CharSequence newElement)
@Deprecated public StringBuilderDelimited append(java.lang.String str)
add(CharSequence)
; change sbd.append(str) into sbd.add(str)str
- the string to append to this StringBuilderDelimited@Deprecated public StringBuilderDelimited append(java.lang.Object o)
add(CharSequence)
; change sbd.append(o) into sbd.add(o.toString())o
- the object whose toString() to append to this StringBuilderDelimited@Deprecated public StringBuilderDelimited append(char c)
add(CharSequence)
; change sbd.append(c) into sbd.add(c.toString())append
in interface java.lang.Appendable
c
- the character to append to this StringBuilderDelimited@Deprecated public StringBuilderDelimited append(java.lang.CharSequence csq)
add(CharSequence)
; change sbd.append(csq) into sbd.add(csq)append
in interface java.lang.Appendable
csq
- the character sequence to append to this StringBuilderDelimited@Deprecated public StringBuilderDelimited append(java.lang.CharSequence csq, int start, int end)
add(CharSequence)
; change sbd.append(csq, start, end) into
sbd.add(csq.subSequence(start, end)append
in interface java.lang.Appendable
@Deprecated public char charAt(int index)
charAt
in interface java.lang.CharSequence
public int length()
length
in interface java.lang.CharSequence
@Deprecated public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object