| | |
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: 419 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for collections, java, sortedmaps, sorting
.net ajax apple applet appportability array automation bidirectional binary bluetooth bold buttons c# c++ class classes code collections component convert coordinates design desktop development dice digit draw ebook eclipse educational error event exception ext firefox fractal game glassfish google gui guidancer helpwithhomework html hyper image input integer java javafx javascript jetbrains jmf jsp julia klocwork link linux loop method microsoft mobile mysql netbeans newbie object oracle packets php plazmic poi problem producer programmer programming project python ruby security service servlet set socket software sort sorting ssl state stream string sun support swing test threads time transfer tree ubuntu web windows






