import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
import java.util.Map;
import java.util.Set;
Table<Integer, Integer, Integer> table = HashBasedTable.<Integer, Integer, Integer>create();
table.put(1, 2, 3);
//允许row和column确定的二维点重复
table.put(1, 6, 3);
//判断row和column确定的二维点是否存在
if(table.contains(1, 2)) {
table.put(1, 4, 4);
table.put(2, 5, 4);
table.put(1,2,1);
}
System.out.println(table);
//获取column为5的数据集
Map<Integer, Integer> column = table.column(5);
System.out.println(column);
//获取rowkey为1的数据集
Map<Integer, Integer> row = table.row(1);
System.out.println(row);
//获取rowKey为1,columnKey为2的的结果
Integer value = table.get(1, 2);
System.out.println(value);
//判断是否包含columnKey的值
System.out.println(table.containsColumn(3));
//判断是否包含rowKey为1的视图