aspose file tools*
The moose likes Beginning Java and the fly likes Search based on  Keys other than HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Search based on  Keys other than HashMap" Watch "Search based on  Keys other than HashMap" New topic
Author

Search based on Keys other than HashMap

Prashanti Potukuchi
Greenhorn

Joined: Sep 19, 2002
Posts: 2
Hi all,
I had a HashMap with some key and value pairs. Now the value part is no more valid. Can anybody suggest an alternative data structure so that i can still search based on the key, (instead of iterating through the entire thing like arrays) and do not have any associated value part.
Thanks
Prashanti
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
So, you just want to know if the key exists or not? No value to retrieve? Sounds like a HashSet.


"I'm not back." - Bill Harding, Twister
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Oh, two more things:
1) Welcome to JavaRanch!
2) Please take another look at our display name policy and edit your display name to include a first and last name. Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Search based on Keys other than HashMap