-
hashmap questions =P
Okey ... so im creating a game now =P and I have some questions about hashmaps ... how can i messure the memory size of a hashmap ? And if im not misstaken ... hashmaps stores objects by reference so it does not save the objects in new memory space?
I have a list of objects and the objects knows their position... is there any way of checking if the mouse is over the objects that does not include any loop ? :P I was thinking of using the pixels in as a key in hashmap to get the object ... but i there must be better ways to do this? =) thanks guys
-
For the first one, get a profiler. For the second one, use a mouselistener.
-
I'm using a mouselistener ... but you still have to loop trough all objects to check witch object the mouse is over ...
-
Depends on what you are plotting and how. And how you organise your data, and possible "trigger" methods.