aspose file tools*
The moose likes Beginning Java and the fly likes Iterating through a hash map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Iterating through a hash map" Watch "Iterating through a hash map" New topic
Author

Iterating through a hash map

Bart Wilson
Greenhorn

Joined: Aug 01, 2001
Posts: 17
I need help on how to proceed this. I need to iterate through a hash map.
Thanks
Bart Wilson
Greenhorn

Joined: Aug 01, 2001
Posts: 17
This is what I got so far, am I on the right track?
Set entries = someObject.getItems().entrySet();
Iterator iterator = entries.iterator();
while (iterator.hasNext())
{
Map.Entry entry = (Map.Entry)iterator.next();

}
[This message has been edited by Bart Wilson (edited November 13, 2001).]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
The following iterates through the keys in a map
Set Keys = yourMap.keySet()
Iterator it = Keys.iterator()
while(it.hasNext())
do whatever...

------------------
Bosun
SCJP for the Java� 2 Platform


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterating through a hash map
 
Similar Threads
Storing ActionForm&action class-WHERE?
need help copying hashmaps
Load Testing Using Jmeter
Sorting Maps
Doubt in Hash Map and Hash Table