MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / getTableId

Method getTableId

src/java/simpledb/common/Catalog.java:126–139  ·  view source on GitHub ↗

Return the id of the table with a specified name, @throws NoSuchElementException if the table doesn't exist

(String name)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

getNameMethod · 0.80
getMethod · 0.80
equalsMethod · 0.65
getIdMethod · 0.65
getFileMethod · 0.45

Tested by

no test coverage detected