can I dynamically name HashMaps?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: can I dynamically name HashMaps?

  1. #1
    Join Date
    May 2003
    Posts
    1

    can I dynamically name HashMaps?

    Evening all.

    Can you dynamically name objects? for example I would like to name a large number of HashMaps & ArrayLists of pre defined names.

    Currently I'm naming then directly, but it seems inefficient.

    E.g
    HashMap Blue = null;
    HashMap lightblue = null;
    HashMap midblue = null;
    HashMap darkblue = null;


    and so on...

    Could I save the HashMap names in a separate file (XML?) and loop through each entry to name all may HashMaps or ArrayLists?

    <main>Blue</main>
    <sub>lightblue</sub>
    <sub>midblue</sub>
    <sub>darkblue</sub>

    and so on...

    cheers all

  2. #2
    Join Date
    Mar 2003
    Posts
    86

    Why not?!?

    Just have a List member, when the calss starts (add a static block), load all names from porp file, and create corresponding maps. You will however have to think of a way to know what si stored where...


    Sharbov.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center