2015-06-20 56 views
0

我有下面的類,它使用谷歌番石榴地圖,現在唯一的疑問是它已經創建了一個列表,你可以看到,但我要保持這個名單在屬性文件seprately因爲後來很多新項目將被添加在這個列表中刪除,所以我想開發商只更改屬性文件在java中的屬性文件中分別保存數組列表的內容

下面是代碼

final Table<String, String, List<String>> values = HashBasedTable.create(); 
     values.put("Tbon", "cy", Lists.newArrayList("cat1","cat12","cat13","cat14")); 
     values.put("Tbon", "ype", Lists.newArrayList("rat1","rat2","rat3")); 

for (Cell<String, String, List<String>> cell: values.cellSet()){ 
      System.out.println(cell.getRowKey()+" "+cell.getColumnKey()+" "+cell.getValue()); 
     } 

現在你可以看到這兩個數組列表在這裏硬編碼"cat1","cat12","cat13","cat14""rat1","rat2","rat3"但我想保留這個數組l IST在屬性文件seprately,以便它可以是對行鍵映射,以便屬性文件的內容會像可以說屬性的文件名保存在我的本地計算機C abc.properties:驅動

cy cat1 
    cy cat12 
    cy cat13 
    cy cat14 
    ype rat1 
    ype rat2 
    ype rat3 

所以請告知,如果我將這個映射保存在屬性文件中,那麼它們將如何在數據結構值中被調用

回答

相關問題