Map結構取數據這個方法比Iterator和foreach效率稍高。

Map<String,Map<String,List<String>>> tempMap = songHighlight.getHighlighting();
			for(Map.Entry<String, Map<String,List<String>>> entry : tempMap.entrySet()) {
				if(Integer.parseInt(entry.getKey()) == song.getSong_SongID()) {
 
					for(Map.Entry<String, List<String>> entryLayer2 : entry.getValue().entrySet()) {
						if(null != entryLayer2.getKey() && "Song_Name".equals(entryLayer2.getKey())) {
							//your Operation
						}
						if(null != entryLayer2.getKey() && "Song_SingerName".equals(entryLayer2.getKey())) {
							//your Operation
						}
					}
				}
			}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章