(
CharSequence sequence,
int start,
int end,
char replacement,
StringBuilder builder,
boolean inMatchingGroup)
| 1033 | } |
| 1034 | |
| 1035 | private String finishCollapseFrom( |
| 1036 | CharSequence sequence, |
| 1037 | int start, |
| 1038 | int end, |
| 1039 | char replacement, |
| 1040 | StringBuilder builder, |
| 1041 | boolean inMatchingGroup) { |
| 1042 | for (int i = start; i < end; i++) { |
| 1043 | char c = sequence.charAt(i); |
| 1044 | if (matches(c)) { |
| 1045 | if (!inMatchingGroup) { |
| 1046 | builder.append(replacement); |
| 1047 | inMatchingGroup = true; |
| 1048 | } |
| 1049 | } else { |
| 1050 | builder.append(c); |
| 1051 | inMatchingGroup = false; |
| 1052 | } |
| 1053 | } |
| 1054 | return builder.toString(); |
| 1055 | } |
| 1056 | |
| 1057 | /** |
| 1058 | * @deprecated Provided only to satisfy the {@link Predicate} interface; use {@link #matches} |
no test coverage detected