Return the id of the table with a specified name, @throws NoSuchElementException if the table doesn't exist
(String name)
| 124 | * @throws NoSuchElementException if the table doesn't exist |
| 125 | */ |
| 126 | public int getTableId(String name) throws NoSuchElementException { |
| 127 | // some code goes here |
| 128 | if(name!=null){ |
| 129 | for(int i=0;i<this.tables.size();i++){ |
| 130 | if(this.tables.get(i).getName()==null){ |
| 131 | continue; |
| 132 | } |
| 133 | if(this.tables.get(i).getName().equals(name)){ |
| 134 | return this.tables.get(i).getFile().getId(); |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | throw new NoSuchElementException(); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * 通过tableId获取table |