Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Appendable

public interface Appendable

java.lang.Appendable
Known Indirect Subclasses


Declares methods to append characters or character sequences. Any class that implements this interface can receive data formatted by a 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.

Summary

Public methods

abstract Appendable append(CharSequence csq)

Appends the character sequence csq.

abstract Appendable append(CharSequence csq, int start, int end)

Appends a subsequence of csq.

abstract Appendable append(char c)

Appends the specified character.

Public methods

append

Added in API level 1
Appendable append (CharSequence csq)

Appends the character sequence 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.

Parameters
csq CharSequence: the character sequence to append.
Returns
Appendable this Appendable.
Throws
IOException if an I/O error occurs.

append

Added in API level 1
Appendable append (CharSequence csq, 
                int start, 
                int end)

Appends a subsequence of 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.

Parameters
csq CharSequence: the character sequence to append.
start int: the first index of the subsequence of csq that is appended.
end int: the last index of the subsequence of csq that is appended.
Returns
Appendable this Appendable.
Throws
IndexOutOfBoundsException if start < 0, end < 0, start > end or end is greater than the length of csq.
IOException if an I/O error occurs.

append

Added in API level 1
Appendable append (char c)

Appends the specified character.

Parameters
c char: the character to append.
Returns
Appendable this Appendable.
Throws
IOException if an I/O error occurs.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.