File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Collections" Watch "Collections" New topic


Bill Norton

Joined: Mar 29, 2001
Posts: 27
I have looked at HashTable, trees, etc for my situation but having a hard choosing which one is the best choice.
My data might look like this each entry has:
Social Security Number <- unique
Company Number <- unique
Job <- not-unique
Age <- not-unique
Now I need to be able to search Social Security Number or Company Number get the other three items
I will never need to search by Job or Age.
What is the best coolection for this. Also, this may or not be important but the serial numbers follow a tree structure.
Any help would be welcome.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
What about storing all the information in an ArrayList, and then store the arraylist in a hasmap twice. using the SS# and Company # as the keys. OTOH, you can just use two maps.


So much trouble in the world -- Bob Marley
Bill Norton

Joined: Mar 29, 2001
Posts: 27
Thank for the suggestions. What would be the fastest way?
wood burning stoves
subject: Collections