yf0994 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Reintroduce FluentIterable.append(Iterable<? extends E> other) and FluentIterable.append(E... elements) #1072

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to have a FluentIterable equivalent to the Iterables.concat 
methods...

I recognized that there once were "append" methods in FluentIterable, but they 
have been removed in rev 323b48157718 - but i couldn't find any reason why.

Original issue reported on code.google.com by drothma...@googlemail.com on 17 Jul 2012 at 3:16

GoogleCodeExporter commented 9 years ago
We'll discuss this at API review this week and get back to this.

Original comment by kurt.kluever on 24 Jul 2012 at 5:23

GoogleCodeExporter commented 9 years ago
Are there any updates for this issue?

A function FluentIterable.append or, to be in sync with the Iterables-Methods, 
FluentIterable.concat would make FluentIterable more useful.

For example, 
FluentIterable.from(Arrays.asList(1,2,3).concat(Arrays.asList(4,5,6).toList()

This isn't even much longer than the same expression when using 
ImmutableList.builder, but it can be applied to all ImmutableCollections which 
can be directly created from the FluentIterable. That way, fluentiterable could 
become a kind of generalized builder for collections.

And, of course its main usage, it allows to concat Iterables cheaply on the fly 
before processing them. Multiple invocations like concat(a).concat(b) could 
surely be translated to Iterables.concat(Arrays.asList(a,b)), so the repeated 
calls could be on par performancewise with the more flexible methods from 
Iterables.

Original comment by Eric6i...@googlemail.com on 12 May 2013 at 10:43

GoogleCodeExporter commented 9 years ago
We never meant these methods to be missing so long. I *think* we just meant to 
get the rename to concat finished before putting them out there. But we had put 
SO much time into FluentIterable and held the release up. Once we got it out 
without this I think we were all done thinking about FluentIterable for a 
while. :-)

Original comment by kevinb@google.com on 24 May 2013 at 5:31

GoogleCodeExporter commented 9 years ago
Let's try to resolve this one way or another for 18.

Original comment by cgdecker@google.com on 15 Apr 2014 at 10:20

GoogleCodeExporter commented 9 years ago
These methods should show up the next time we sync.

Original comment by cgdecker@google.com on 7 Jul 2014 at 5:47

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:14

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08