java.lang
public
interface
java.lang.Appendable
Appendable is an object used to append character or character sequence. Any
class implements this interface can receive data formatted by
Formatter
. The appended character or character sequence
should be valid accroding to the rules described
Unicode Character Representation
.
Appendable itself does not gurantee thread safety. This responsibility is up
to the implementing class.
The implementing class can choose different exception handling mechanism. It
can choose to throw exceptions other than IOException but which must be
compatible with IOException, or does not throw any exceptions at all and use
error code instead. All in all, the implementing class does not gurantee to
propagate the exception declared by this interface.
Known Indirect Subclasses
BufferedWriter,
CharArrayWriter,
CharBuffer,
Editable,
FileWriter,
FilterWriter,
OutputStreamWriter,
PipedWriter,
PrintStream,
PrintWriter,
SpannableStringBuilder,
StringBuffer,
StringBuilder,
StringWriter,
Writer
BufferedWriter |
BufferedWriter is for writing buffered character output. |
CharArrayWriter |
CharArrayWriter is used as a character output stream on a character array. |
CharBuffer |
A buffer of char s. |
Editable |
This is the interface for text whose content and markup
can be changed (as opposed
to immutable text like Strings). |
FileWriter |
FileWriter is a class for writing characters out to a file. |
FilterWriter |
FilterWriter is a class which takes a Writer and filters the
output in some way. |
OutputStreamWriter |
OutputStreamWriter is a class for turning a character output stream into a
byte output stream. |
PipedWriter |
PipedWriter is a class which places information on a communications pipe. |
PrintStream |
PrintStream is a class which takes an OutputStream and provides convenience
methods for printing common data types in a human readable format on the
stream. |
PrintWriter |
PrintWriter is a class which takes either an OutputStream or Writer and
provides convenience methods for printing common data types in a human
readable format on the stream. |
SpannableStringBuilder |
This is the class for text whose content and markup can both be changed. |
StringBuffer |
StringBuffer is a variable size contiguous indexable array of characters. |
StringBuilder |
A modifiable sequence of characters for use in creating
and modifying Strings. |
StringWriter |
StringWriter is an class for writing Character Streams to a StringBuffer. |
Writer |
Writer is an Abstract class for writing Character Streams. |
Summary
Details
Public Methods
Append the given
CharSequence
.
The behaviour of this method depends on the implementation class of
Appendable
.
If the give CharSequence
is null, the sequence is treated as
String "null".
Parameters
csq
| the CharSequence to be append |
Append part of the given
CharSequence
.
If the given CharSequence
is not null, this method behaves
same as the following statement:
out.append(csq.subSequence(start, end))
If the give CharSequence
is null, the sequence is treated as
String "null".
Parameters
csq
| the CharSequence to be append |
start
| the index to spicify the start position of
CharSequence to be append, must be non-negative,
and not larger than the end |
end
| the index to speicify the end position of
CharSequence to be append, must be non-negative,
and not larger than the size of csq |
public
Appendable
append(char c)
Append the given character.
Parameters
c
| the character to append |