File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Which java Collections Shall i Use? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Which java Collections Shall i Use?" Watch "Which java Collections Shall i Use?" New topic
Author

Which java Collections Shall i Use?

Imran Akbar
Ranch Hand

Joined: May 06, 2010
Posts: 63

i have a requirement,

lets say i need to maintain a list of slots which have a key from 00 to 99, and it will contain another value called id, when a request comes i select 00 key first and allocates a id, likewise when i get the response back i will remove the allocated id and make it null, when some request comes in i want to get the available slot and insert the id on the available slot


tell me which collections should i go with or do i need to create a new data structure for this?


Gopi Chella
Ranch Hand

Joined: Apr 26, 2010
Posts: 52
HashMap will be good for Key/Value pair.


SCJP 1.5
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Which java Collections Shall i Use?
 
Similar Threads
Jess Question
Any study groups in Calcutta
SEVERE: BAD packet signature 200,SEVERE: Caught exception (java.lang.NullPointerException)
Cache Records(Benefits)
refresh a JPanel automatically as time changes