mengdiwang / guava-libraries

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

Add IntRange #506

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please provide a class representing range of integers to allow writing code 
like this:

IntRange.range(1, 10).transform(f)

instead of

List<Type> result = new ArrayList<Type>();
for (int i = 1; i <= 10; ++i) {
  result.add(f(i));
}

Original issue reported on code.google.com by kopperni...@gmail.com on 27 Dec 2010 at 8:06

GoogleCodeExporter commented 9 years ago
I support this, but I'd move it to the Ints class.

Ints.rangeAsList(a, b) maybe?

Original comment by SeanPFl...@googlemail.com on 27 Dec 2010 at 6:05

GoogleCodeExporter commented 9 years ago
I think this is a duplicate of Issue #322

Original comment by fin...@gmail.com on 28 Dec 2010 at 9:52

GoogleCodeExporter commented 9 years ago
Also see this mailing list thread:

http://groups.google.com/group/guava-discuss/t/9a9fb2dd814c8937

Original comment by fin...@gmail.com on 28 Dec 2010 at 9:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, I think it is duplicate but has better title ;-)

Original comment by kopperni...@gmail.com on 28 Dec 2010 at 10:16

GoogleCodeExporter commented 9 years ago

Original comment by boppenh...@google.com on 30 Dec 2010 at 1:21

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:15

GoogleCodeExporter commented 9 years ago

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