Question: Complete the TODO in below code: public Tuple lookup ( Object key ) { String keyColumnName = schema.getKey ( ) ; if ( keyColumnName =

Complete the TODO in below code: public Tuple lookup(Object key){
String keyColumnName = schema.getKey();
if (keyColumnName == null) throw new RuntimeException("Cannot lookup by key when schema does not have a key.");
//TODO
// find the row with the given key value
throw new UnsupportedOperationException();
}
@Override
public ITable lookup(String colname, Object value){
ITable result = new Table(schema);
// TODO
// find all rows with the given column value
// insert the row into result table and return
throw new UnsupportedOperationException();
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!