Code: Show/Hide Hashtable h = new Hashtable();
Vector vect = new Vector(); h.put("Main",v); |
Code: Show/Hide Enumeration e = h.keys();
while(h.hasMoreElements()){ //... iterate, checking to see if this works: String temp = (String)e.nextElement(); if(h.get(temp)!=null) return temp; } |
Dr Brain wrote: |
Why do you need to do this? |
Cyan~Fire wrote: |
There's just more efficient ways of doing things depending on what you need them for... |
Helicon wrote: |
i'm not a moron... i know when i need to use a hashtable.
The trouble here is that somewhere down the hierarchy there are vectors(hence arrays) containing the keys which yield the hashes and the objects themselves. It would be simple, given these, to just match up indices and return either. However, i don't feel like extending my way down the hierarchy to accomplish this. It just seems like having to iterate twice to find objects which reside at the same index is a little screwy... perhaps i'm wrong about the indices... it may be by hash, but that would be just a small drag compared to an iteration... my collections don't have defined limits in this case... that would severely bite my already lagging java performance |