1.table相关
public static void main(String[] args) {
//HashBasedTable.<Integer, Integer, Integer> 表示为 HashBasedTable.<RowKey, ColumnKey, val>
Table<Integer, Integer, Integer> table = HashBasedTable.<Integer, Integer, Integer>create();
table.put(1, 2, 3);
//允许row和column确定的二维点重复
table.put(1, 6, 3);
//table={1={2=3, 6=3}}
//判断row和column确定的二维点是否存在
if(table.contains(1, 2)) {
table.put(1, 4, 4);
table.put(2, 5, 4);
}
System.out.println(table);
//获取column为5的数据集
Map<Integer, Integer> column = table.column(5);
//返回结果是 Map<RowKey, val> 的值
System.out.println(column);
//获取rowkey为1的数据集
Map<Integer, Integer> row = table.row(1);
System.out.println(row);
//获取rowKey为1,columnK