相当于双键的Map
Table<String,String,Integer> table = HashBasedTable.create(); table.put("json","a",100); table.put("json","b",90); table.put("marry","a",95); table.put("marry","c",80); Set<Table.Cell<String,String,Integer>> set = table.cellSet(); Table.Cell tc = set.iterator().next(); System.out.println(tc.getColumnKey()); System.out.println(set);
结果:
a
[(marry,a)=95, (marry,c)=80, (json,a)=100, (json,b)=90]