public class ReplacerChain extends StrReplacer implements Chain<StrReplacer,ReplacerChain>
| 构造器和说明 |
|---|
ReplacerChain(StrReplacer... strReplacers)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
ReplacerChain |
addChain(StrReplacer element)
加入责任链
|
Iterator<StrReplacer> |
iterator() |
protected int |
replace(CharSequence str,
int pos,
StringBuilder out)
抽象的字符串替换方法,通过传入原字符串和当前位置,执行替换逻辑,返回处理或替换的字符串长度部分。
|
applyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratoridentitypublic ReplacerChain(StrReplacer... strReplacers)
strReplacers - 字符串替换器public Iterator<StrReplacer> iterator()
iterator 在接口中 Iterable<StrReplacer>public ReplacerChain addChain(StrReplacer element)
ChainaddChain 在接口中 Chain<StrReplacer,ReplacerChain>element - 责任链新的环节元素protected int replace(CharSequence str, int pos, StringBuilder out)
StrReplacerreplace 在类中 StrReplacerstr - 被处理的字符串pos - 当前位置out - 输出Copyright © 2023. All rights reserved.