迭代包含在 hashmap 中作为值的 hashmap

Iterating over hashmap contained as value within hashmap

我有一个父 HashMap 像 Hashmap<String, Hashmap<String,Arraylist<Customclass>>> 现在遍历作为父哈希图的第一个哈希图给我值

key1------[subHashmap的key(value)] key2------[subHashmap的key(value)] . . . 现在我想根据它们的键迭代父散列图值中的散列图。

我将如何实现这一目标。 .

应该这样做:

    for (Map.Entry<String, HashMap<String, ArrayList<CustomClass>> entry : outerHashMap.entrySet()) {
String entryKey= entry.getKey();
// ...
for (Map.Entry<String, ArrayList<CustomClass> nestedentry : entry.getValue().entrySet()) {
    String name = nestedEntry.getKey();
    ArrayList<CustomClass> value = nestedEntry.getValue();
    // ...
}
}