Loose end: concat
Joe Bowbeer
joe.bowbeer at gmail.com
Thu May 23 13:15:02 PDT 2013
Why was an instance method rejected? I can't recall.
s = s1.concat(s2).concat(s3);
On Thu, May 23, 2013 at 11:23 AM, Sam Pullara <spullara at gmail.com> wrote:
> *Stream seems like the right place for them to me. It is certainly the
> second place I would look — first place would be as an instance method, but
> we've discussed that before.
>
> Sam
>
> On May 23, 2013, at 11:06 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
>
> > I cleaned up concat() and wrote Int/Long/Double versions. (Fortunately,
> with the recent addition of Spliterator.OfPrimitive, the duplication
> quotient was much lower.)
> >
> > Currently these still live in Streams. Is that still the right place?
> The stream classes (Stream, IntStream, etc) seem a little wrong for them,
> but I can't quite put my finger on why.
> >
> > Specs:
> >
> > /**
> > * Creates a lazy concatenated {@code Stream} whose elements are all
> the
> > * elements of a first {@code Stream} succeeded by all the elements
> of the
> > * second {@code Stream}. The resulting stream is ordered if both
> > * of the input streams are ordered, and parallel if either of the
> input
> > * streams is parallel.
> > *
> > * @param <T> The type of stream elements
> > * @param a the first stream
> > * @param b the second stream to concatenate on to end of the first
> > * stream
> > * @return the concatenation of the two input streams
> > */
> > public static <T> Stream<T> concat(Stream<? extends T> a, Stream<?
> extends T> b) {
> >
> >
> > /**
> > * Creates a lazy concatenated {@code IntStream} whose elements are
> all the
> > * elements of a first {@code IntStream} succeeded by all the
> elements of the
> > * second {@code IntStream}. The resulting stream is ordered if both
> > * of the input streams are ordered, and parallel if either of the
> input
> > * streams is parallel.
> > *
> > * @param a the first stream
> > * @param b the second stream to concatenate on to end of the first
> stream
> > * @return the concatenation of the two streams
> > */
> > public static IntStream concat(IntStream a, IntStream b) {
> >
> >
> > (and similar for Long and Double).
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130523/25c9e461/attachment.html
More information about the lambda-libs-spec-experts
mailing list