src/java.base/share/classes/java/lang/String.java
changeset 47463 30186b6741b8
parent 47216 71c04702a3d5
child 48065 c4f2b6749c86
equal deleted inserted replaced
47462:b1b37e21fb6f 47463:30186b6741b8
  2662      * from this sequence.  Any char which maps to a <a
  2662      * from this sequence.  Any char which maps to a <a
  2663      * href="{@docRoot}/java/lang/Character.html#unicode">surrogate code
  2663      * href="{@docRoot}/java/lang/Character.html#unicode">surrogate code
  2664      * point</a> is passed through uninterpreted.
  2664      * point</a> is passed through uninterpreted.
  2665      *
  2665      *
  2666      * @return an IntStream of char values from this sequence
  2666      * @return an IntStream of char values from this sequence
       
  2667      * @since 9
  2667      */
  2668      */
  2668     @Override
  2669     @Override
  2669     public IntStream chars() {
  2670     public IntStream chars() {
  2670         return StreamSupport.intStream(
  2671         return StreamSupport.intStream(
  2671             isLatin1() ? new StringLatin1.CharsSpliterator(value, Spliterator.IMMUTABLE)
  2672             isLatin1() ? new StringLatin1.CharsSpliterator(value, Spliterator.IMMUTABLE)
  2681      * to the stream. Any other code units, including ordinary BMP characters,
  2682      * to the stream. Any other code units, including ordinary BMP characters,
  2682      * unpaired surrogates, and undefined code units, are zero-extended to
  2683      * unpaired surrogates, and undefined code units, are zero-extended to
  2683      * {@code int} values which are then passed to the stream.
  2684      * {@code int} values which are then passed to the stream.
  2684      *
  2685      *
  2685      * @return an IntStream of Unicode code points from this sequence
  2686      * @return an IntStream of Unicode code points from this sequence
       
  2687      * @since 9
  2686      */
  2688      */
  2687     @Override
  2689     @Override
  2688     public IntStream codePoints() {
  2690     public IntStream codePoints() {
  2689         return StreamSupport.intStream(
  2691         return StreamSupport.intStream(
  2690             isLatin1() ? new StringLatin1.CharsSpliterator(value, Spliterator.IMMUTABLE)
  2692             isLatin1() ? new StringLatin1.CharsSpliterator(value, Spliterator.IMMUTABLE)