This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Iterating over MultiValueMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Iterating over MultiValueMap" Watch "Iterating over MultiValueMap" New topic

Iterating over MultiValueMap

Adam Kovari

Joined: Aug 08, 2008
Posts: 7
i'm trying to find a way to iterate over every key in a MultiValueMap. Is there any way to get an interation over all keys?

Thanks a lot in advance

Steve Luke

Joined: Jan 28, 2003
Posts: 4181

If you mean the then you can get all the keys via the multiMap.keySet().iterator() method, or get all the entries (one for each key, having a collection as the value) using the multiMap.entrySet().iterator().

I assume any other MultiValueMap would also be an implementation of java.util.Map and so would also have these same methods.

Adam Kovari

Joined: Aug 08, 2008
Posts: 7
Thank you for your fast reply, that's what I was looking for.

I agree. Here's the link:
subject: Iterating over MultiValueMap
It's not a secret anymore!