Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何迭代HashMap<;字符串,ArrayList<;记录>&燃气轮机;在爪哇?_Java_Generics_Collections_Hashmap - Fatal编程技术网

Java 如何迭代HashMap<;字符串,ArrayList<;记录>&燃气轮机;在爪哇?

Java 如何迭代HashMap<;字符串,ArrayList<;记录>&燃气轮机;在爪哇?,java,generics,collections,hashmap,Java,Generics,Collections,Hashmap,我想访问我在HashMap中创建的记录。 由于某些要求,我无法创建用于保存数据的新数据结构 private HashMap<String, ArrayList<Record>> customerInfoTable = new HashMap<String, ArrayList<Record>>(); private HashMap customerInfoTable=new HashMap(); getKeyList()获取键列表,然后为每个

我想访问我在HashMap中创建的记录。
由于某些要求,我无法创建用于保存数据的新数据结构

private HashMap<String, ArrayList<Record>> customerInfoTable = new 
HashMap<String, ArrayList<Record>>();
private HashMap customerInfoTable=new
HashMap();
  • getKeyList()获取键列表,然后为每个get值
  • Iterator>it=map.entrySet().Iterator(); while(it.hasNext()){ Map.Entry=it.next();}

  • 您尝试了什么?您遇到了什么问题?
    for(List rs:customerInfoTable.values())for(Record r:rs){…}