Add a new table to the catalog. This table's contents are stored in the specified DbFile. @param file the contents of the table to add; file.getId() is the identfier of this file/tupledesc param for the calls getTupleDesc and getFile @param name the name of the table -- may be an empty string.
(DbFile file, String name, String pkeyField)
| 89 | * @param pkeyField the name of the primary key field |
| 90 | */ |
| 91 | public void addTable(DbFile file, String name, String pkeyField) { |
| 92 | // some code goes here |
| 93 | Table table = new Table(file, name, pkeyField); |
| 94 | for(int i=0;i<this.tables.size();i++){ |
| 95 | Table tmp = this.tables.get(i); |
| 96 | if (tmp.getName()==null){ |
| 97 | continue; |
| 98 | } |
| 99 | if(tmp.getName().equals(name) || tmp.getFile().getId()==file.getId()){ |
| 100 | this.tables.set(i,table); |
| 101 | return; |
| 102 | } |
| 103 | } |
| 104 | this.tables.add(table); |
| 105 | } |
| 106 | |
| 107 | public void addTable(DbFile file, String name) { |
| 108 | addTable(file, name, ""); |
no test coverage detected