int rows = sheet.getRows();
int cols = sheet.getColumns();
StringBuffer sb = new StringBuffer();
Map<String,Integer> maps=new HashMap<String,Integer>();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
sb.append((sheet.getCell(j, i)).getContents()).append(",");
maps.put((sheet.getCell(j, i)).getContents(), 1);
}
sb.append("\n");
}
Map<String,Integer> map=new TreeMap<String,Integer>();
for(Map.Entry<String, Integer> entry:maps.entrySet()){
if(map.get(entry.getKey())!=null && ){
}
}
想判断key值是否有重复,重复的value加1否则直接put进去,不知道if该怎么写 求解 |
|