Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8071597

Add Stream dropWhile and takeWhile operations

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Backports

        Description

        Add two new operations to Stream and primitive specializations:

          1) Stream.takeWhile(Predicate<? super T> test)
              Returns a stream consisting of the longest prefix of elements of this stream
              that match the given predicate
          2) Stream.dropWhile(Predicate<? super T> test)
              Returns a stream consisting of the remaining elements of this stream
              after dropping the longest prefix of elements that match the given predicate.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  psandoz Paul Sandoz
                  Reporter:
                  psandoz Paul Sandoz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: