I find myself in need of a data structure which only needs the ability to enter objects, retrieve and delete them (I have no interest in its size and etc..). This data structure will be accessed from multiple threads both adding and getting specific objects. Currently I am using in my program a concurrent HashMap:
key = object.hashCode()
data = object
The question: I was wondering this is the best way to go ?
Note:
I do not add any object twice
the only hashMap methods i use are get, put, remove.
Thanks alot!