新聞中心
Appendable

成都創(chuàng)新互聯(lián)公司客戶idc服務(wù)中心,提供成都服務(wù)器托管、成都服務(wù)器、成都主機(jī)托管、成都雙線服務(wù)器等業(yè)務(wù)的一站式服務(wù)。通過(guò)各地的服務(wù)中心,我們向成都用戶提供優(yōu)質(zhì)廉價(jià)的產(chǎn)品以及開(kāi)放、透明、穩(wěn)定、高性價(jià)比的服務(wù),資深網(wǎng)絡(luò)工程師在機(jī)房提供7*24小時(shí)標(biāo)準(zhǔn)級(jí)技術(shù)保障。
public interface Appendable可以附加字符序列和值的對(duì)象。 Appendable 接口必須由其實(shí)例旨在從 Formatter 接收格式化輸出的任何類實(shí)現(xiàn)。
要附加的字符應(yīng)該是有效的 Unicode 字符,如 Unicode 字符表示中所述。 請(qǐng)注意,補(bǔ)充字符可能由多個(gè) 16 位 char 值組成。
附加組件對(duì)于多線程訪問(wèn)不一定是安全的。 線程安全是擴(kuò)展和實(shí)現(xiàn)此接口的類的責(zé)任。
由于該接口可能由具有不同錯(cuò)誤處理風(fēng)格的現(xiàn)有類實(shí)現(xiàn),因此無(wú)法保證錯(cuò)誤將傳播到調(diào)用者。
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| Appendable | append(char c) | 將指定的字符附加到此 Appendable。 |
| Appendable | append(CharSequence csq) | 將指定的字符序列附加到此 Appendable。 |
| Appendable | append(CharSequence csq, int start, int end) | 將指定字符序列的子序列附加到此 Appendable。 |
方法詳情
append
Appendable append(CharSequence csq) throws IOException
將指定的字符序列附加到此 Appendable。
根據(jù)哪個(gè)類實(shí)現(xiàn)了字符序列 csq,可能不會(huì)附加整個(gè)序列。 例如,如果 csq 是一個(gè) CharBuffer,那么要追加的子序列由緩沖區(qū)的位置和限制定義。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| csq | 要追加的字符序列。 如果 csq 為 null,則將四個(gè)字符“null”附加到此 Appendable。 |
返回:
對(duì)本附錄的引用
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 如果發(fā)生 I/O 錯(cuò)誤 |
append
Appendable append(CharSequence csq, int start, int end) throws IOException
將指定字符序列的子序列附加到此 Appendable。
當(dāng) csq 不為空時(shí),以 out.append(csq, start, end) 形式調(diào)用此方法的行為與調(diào)用完全相同
out.append(csq.subSequence(start, end)) 參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| csq | 從中追加子序列的字符序列。 如果 csq 為 null,則將附加字符,就好像 csq 包含四個(gè)字符“null”。 |
| start | 子序列中第一個(gè)字符的索引 |
| end | 子序列中最后一個(gè)字符之后的字符的索引 |
返回:
對(duì)本附錄的引用
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IndexOutOfBoundsException | 如果 start 或 end 為負(fù)數(shù),則 start 大于 end,或者 end 大于 csq.length() |
| IOException | 如果發(fā)生 I/O 錯(cuò)誤 |
append
Appendable append(char c) throws IOException
將指定的字符附加到此 Appendable。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| c | 要附加的字符 |
返回:
對(duì)本附錄的引用
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IOException | 如果發(fā)生 I/O 錯(cuò)誤 |
分享文章:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSAppendable
URL分享:http://fisionsoft.com.cn/article/dhgdchj.html


咨詢
建站咨詢
