【发布时间】:2014-04-12 15:52:44
【问题描述】:
我有一个返回 null 的函数。
示例输入:
String alice=table.get("Alice","Smith");
这是我的代码:
public void setTab() {
table.put("Alice","Smith","Manager");
...
}
// get all persons with a surname of Smith
final Collection<String> smiths = table.column("Smith").values();
// get all persons with a firstName of Bob
final Collection<String> bobs = table.row("Bob").values();
// get a specific person
final String alice=table.get("Alice", "Smith");
public void printSpecial() {
System.out.println(alice);
System.out.println(smiths);
System.out.println(bobs);
}
public void prinTab() {
for (Cell<String, String,String> cell: table.cellSet()){
System.out.println(cell.getRowKey()+" "+cell.getColumnKey()+" "+cell.getValue());
}
}
【问题讨论】: