public interface Appendable
java.util.Formatter
. The appended character or character sequence
should be valid according to the rules described in
Unicode Character Representation
.
Appendable
itself does not guarantee thread safety. This
responsibility is up to the implementing class.
Implementing classes can choose different exception handling mechanism. They
can choose to throw exceptions other than IOException
or they do not
throw any exceptions at all and use error codes instead.
Modifier and Type | Method and Description |
---|---|
Appendable |
append(char c)
Appends the specified character.
|
Appendable |
append(CharSequence csq)
Appends the character sequence
csq . |
Appendable |
append(CharSequence csq,
int start,
int end)
Appends a subsequence of
csq . |
Appendable append(char c) throws IOException
c
- the character to append.Appendable
.IOException
- if an I/O error occurs.Appendable append(CharSequence csq) throws IOException
csq
. Implementation classes may
not append the whole sequence, for example if the target is a buffer with
limited size.
If csq
is null
, the characters "null" are appended.
csq
- the character sequence to append.Appendable
.IOException
- if an I/O error occurs.Appendable append(CharSequence csq, int start, int end) throws IOException
csq
.
If csq
is not null
then calling this method is equivalent
to calling append(csq.subSequence(start, end))
.
If csq
is null
, the characters "null" are appended.
csq
- the character sequence to append.start
- the first index of the subsequence of csq
that is
appended.end
- the last index of the subsequence of csq
that is
appended.Appendable
.IndexOutOfBoundsException
- if start < 0
, end < 0
, start > end
or end
is greater than the length of csq
.IOException
- if an I/O error occurs.