Results 1 to 4 of 4
  1. #1
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    6

    Talking 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

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    For the first one, get a profiler. For the second one, use a mouselistener.

  3. #3
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    6

    Default

    I'm using a mouselistener ... but you still have to loop trough all objects to check witch object the mouse is over ...

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Depends on what you are plotting and how. And how you organise your data, and possible "trigger" methods.

Similar Threads

  1. HashMap Help
    By digitol97 in forum New To Java
    Replies: 4
    Last Post: 09-13-2010, 03:38 AM
  2. Replies: 7
    Last Post: 12-08-2009, 08:17 PM
  3. HashMap
    By koolhoney in forum Advanced Java
    Replies: 1
    Last Post: 03-30-2009, 09:08 PM
  4. hashmap
    By tOpach in forum New To Java
    Replies: 2
    Last Post: 09-24-2008, 01:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •