220 } 221 char c1 = charAt(cur++); 222 if (Character.isHighSurrogate(c1) && cur < length) { 223 char c2 = charAt(cur); 224 if (Character.isLowSurrogate(c2)) { 225 cur++; 226 return Character.toCodePoint(c1, c2); 227 } 228 } 229 return c1; 230 } 231 } 232 233 return StreamSupport.intStream(() -> 234 Spliterators.spliteratorUnknownSize( 235 new CodePointIterator(), 236 Spliterator.ORDERED), 237 Spliterator.ORDERED, 238 false); 239 } 240 } | 220 } 221 char c1 = charAt(cur++); 222 if (Character.isHighSurrogate(c1) && cur < length) { 223 char c2 = charAt(cur); 224 if (Character.isLowSurrogate(c2)) { 225 cur++; 226 return Character.toCodePoint(c1, c2); 227 } 228 } 229 return c1; 230 } 231 } 232 233 return StreamSupport.intStream(() -> 234 Spliterators.spliteratorUnknownSize( 235 new CodePointIterator(), 236 Spliterator.ORDERED), 237 Spliterator.ORDERED, 238 false); 239 } 240 241 /** 242 * Returns a {@code CharSequence} of specified length representing repetitions 243 * of the same character. 244 * 245 * @param c the character to be repeated 246 * @param length the length of resulting {@code CharSequence} 247 * @return a {@code CharSequence} of {@code length} repetitions of 248 * character {@code c}. 249 * @throws IllegalArgumentException if given {@code length} is negative 250 * @since 10 251 */ 252 static CharSequence repetitions(char c, int length) { 253 return new CharRepetitions(c, length); 254 } 255 } |