我使用 String 的 TreeMap 作為 Key,將 value 作為另一個(gè) Map。我的地圖保存 Excel 工作表數(shù)據(jù)。 Map<String, Map<String, ArrayList<String>>> excelData = new TreeMap<String, Map<String, ArrayList<String>>>(
String.CASE_INSENSITIVE_ORDER);我的 excelData 對象大小為 3。我有一個(gè)名為“Dates”的 TreeMapEntry,大小為 2。我想檢索此條目并將其合并為單個(gè)條目。我怎樣才能做到這一點(diǎn)?
1 回答
12345678_0001
TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊
if(excelData.containsKey(key)) {
// Get the value associated with a given key in a TreeMap
Map name = excelData.get(key);
System.out.println("excelData with key " + key + " : " + name);
/* Now you can update this retrieved value. */
}
添加回答
舉報(bào)
0/150
提交
取消
