guava之Table

来源:互联网 发布:ko.js 事件 编辑:程序博客网 时间:2024/05/24 02:07

相当于双键的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]

0 0