Fab Fab - 1 year ago 80
Java Question

JAVA - Storing data from result set to hashmap and aggregating them

as the title, I'd like to store data from result set to hash map and then use them for further processing (max, min, avg, grouping).

So far, I achieved this by using a proper hash map and implementing each operation from scratch - iterating over the hash map (key, value) pairs.

My question is: does it exist a library that performs such operations?
For example, a method that computes the maximum value over a List or a method that, given two same-size arrays, performs a "index-to-index" difference.

Thanks in advance.

Answer Source

There are some usefull functions in Collections API already.

For example max or min


Please investigate collections documentation to see if there is a function that you need. Probably there woulde be.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download