| | |
How hould I use this SortedMap?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hi all, and thanks for your help, in advance.
I 'm stiing here with 2 choices, and I need help deciding which one to take. I want to take certain factors into account(i.e. efficiency, speed)
I have values that I want to place into a SortedMap. I can do this in one of two ways: Every record I want insert has an account number. These are not unique, as one account can have more than one item on its name, i.e. an account number can appear more than once.
I have a choice of two ways to put them into the SortedMap:
1) I can store all the products for an account in array, and use the account number as the key, and the array as the value in the map.
2) I can generate an unique id for every single record and use THAT as the key, and the record as the value. When I read everything from the map, I will then sort by value, not key.
Which choice is the better one? Is either more efficient/faster than the other?
I 'm stiing here with 2 choices, and I need help deciding which one to take. I want to take certain factors into account(i.e. efficiency, speed)
I have values that I want to place into a SortedMap. I can do this in one of two ways: Every record I want insert has an account number. These are not unique, as one account can have more than one item on its name, i.e. an account number can appear more than once.
I have a choice of two ways to put them into the SortedMap:
1) I can store all the products for an account in array, and use the account number as the key, and the array as the value in the map.
2) I can generate an unique id for every single record and use THAT as the key, and the record as the value. When I read everything from the map, I will then sort by value, not key.
Which choice is the better one? Is either more efficient/faster than the other?
I would like a steaming pile of coolbeans smothered in spicy awesomesauce please, with a side of scrambled win.
![]() |
Similar Threads
- Building your own PC (Troubleshooting Dead Machines)
- simple ASP.Net Loginpage with SQL server (ASP.NET)
- Trouble Connecting to Verizon DSL Router with one computer but not another one (Networking Hardware Configuration)
- PXE Error (Troubleshooting Dead Machines)
- Java with Blue J Programming Help (Java)
- upgrade options (Motherboards, CPUs and RAM)
- How do i flush a variable (C)
- Oracle reports: Continous horizontal fields (Oracle)
- Program for calculating miles per gallon (C++)
Other Threads in the Java Forum
- Previous Thread: CHess chesk & Checkmate condition
- Next Thread: SortedMap: a newbie question
Views: 426 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for collections, java, sortedmaps, sorting
.net 3d ajax animated api apple applet apps arguments array automation awt binary browser byte c# c++ capture class classes client code collections component convert converter csv db design development draw eclipse ee error event exception external firefox fractal game google gui gwt high html image input integer java javafx javascript jetbrains jmf jsp jtable julia jvm link linux loan loop method microsoft mysql netbeans newbie object online php problem program programming project projectideas python rim safari security sell set socket software solaris sort sorting source string sun swing terminal test threads time title transfer tree ui virtualbox web windows






