You have three options that depend on whether you only need keys, just values, or both
Set<String> keys = yourMap.keySet();
Collection<YourValueClass> values = yourMap.values();
Set<Map.Entry<String,YourValueClass>> pairs = yourMap.entrySet();
then you can easily iterate over them if you need to. Virtually all of them allow you to iterate using a simple foreach loop:
for (Map.Entry<String,YourClassValue> e : yourMap.entrySet())
source
share