I'm searching the best way to store values in data structure where the values came from querying three columns xxxxxx GROUP BY status, height; (i.e., two columns). the result looks like.
status | height | count |
--------------------------
InUse | 90 | 5 |
InUSe | 80 | 3 |
stock | 80 | 1 |
stock | 120 | 3 |
scrap | 90 | 1 |
Now I wanted to store in some data structure or MultiMap or whatever the best way so that I can get the value of count.
Or
whatever the best way I can manipulate with this values.
One thing I figured is for every unique set of (status, height)--> count I'll get the value of count so how I have to store them.
Can I do something like Map< Map<someENUM, List<Long>>, Long>
Will this help me?
or any other way to store and use this values with less confusion.
status of type ENUM
height of type Long
count of type Long
EDIT: Thanks for your answers @Andy Turner, @OAD and @burhancerit
these answers are working well in java. But I'm sorry for not being specific about my context I use.
The Context where I'm using this is I want to populate a HTML table with this Guava Table suggested by @Andy Turner or
ArrayList<myObject>
suggested by @OAD and @ burhancerit in jstl/EL.
something like this
status | height | count | Height | stock | Scrap | InUSe
-------------------------- ---------------------------------
InUse | 90 | 5 | HTML 90 | 0 | 1 | 5
InUSe | 80 | 3 | ------> Table 80 | 1 | 0 | 3
stock | 80 | 1 | using EL 120 | 3 | 0 | 0
stock | 120 | 3 |
scrap | 90 | 1 |
So, Now which is the best way in this context and how to use them in EL.