public interface Appendable
Formatter
格式化输出的实现。
要追加的字符应该是有效的Unicode字符,如Unicode Character Representation。注意补充字符可以由多个16位char值。
appendables未必是安全的多线程访问。线程安全是扩展和实现此接口的类的责任。
由于该接口可以实现由现有类不同风格的错误处理是没有保证的错误将被传播到调用程序。
Modifier and Type | Method and Description |
---|---|
Appendable |
append(char c)
将指定的字符这
Appendable。
|
Appendable |
append(CharSequence csq)
将指定的字符序列,这
Appendable。
|
Appendable |
append(CharSequence csq, int start, int end)
添加一个序列指定的字符序列,这
Appendable。
|
Appendable append(CharSequence csq) throws IOException
根据这类实现字符序列csq,整个序列可能不追加。例如,如果csq是CharBuffer
然后后续追加的缓冲区的位置和范围定义。
csq
-字符序列添加。如果
csq是
null,然后四个字
"null"附加到这可追加。
IOException
如果I/O错误发生
Appendable append(CharSequence csq, int start, int end) throws IOException
这种形式的out.append(csq, start, end)方法调用时,csq不null,表现在完全相同的方式调用
出来。追加(CSQ。子序列(开始、结束))
csq
-字符序列的子序列将追加。如果
csq是
null,那么人物将追加好像
csq包含四个字符
"null"。
start
-子序列中的第一个字符的索引
end
-子序列中的最后一个字符后的字符的索引
IndexOutOfBoundsException
-如果
start或
end是负面的,
start大于
end,或
end大于
csq.length()
IOException
如果I/O错误发生
Appendable append(char c) throws IOException
c
-附加的字符
IOException
如果I/O错误发生
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.