Closed GoogleCodeExporter closed 9 years ago
Internally, Google has some statistics classes that do what you want. They take
a
collection of a numeric elements as input and compute the sum, median, standard
deviation, etc. While those methods are useful, they probably don't belong in a
collection library.
To determine the number of elements that satisfy a predicate, say
int count = Collections2.filter(collection, predicate).size();
It's not clear whether there should be an Iterables method that provides that
logic
directly.
Original comment by jared.l....@gmail.com
on 6 Sep 2009 at 6:05
Couldn't this be solved with a Fold Function (Issue 218)?
Original comment by andre.ru...@gmail.com
on 7 Sep 2009 at 11:22
A fold/reduce method would also work, though a standalone sum() method would be
just
as concise and more readable. Besides, as Kevin explained in issue 218, we
aren't
eager to add more functional programming logic to the library.
Original comment by jared.l....@gmail.com
on 8 Sep 2009 at 6:01
Our math-related libraries are on my radar screen for the Guava project. Will
close
this one.
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 4:53
Original issue reported on code.google.com by
brianopp
on 6 Sep 2009 at 9:04