public class TableScan extends Object implements UpdateScan
| Constructor and Description |
|---|
TableScan(TableInfo ti,
Transaction tx)
Creates a new table scan, and opens its corresponding record file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beforeFirst()
Positions the scan before its first record.
|
void |
close()
Closes the scan and its subscans, if any.
|
void |
delete()
Deletes the current record from the scan.
|
RecordId |
getRecordId()
Returns the RecordId of the current record.
|
Constant |
getVal(String fldName)
Returns the value of the specified field, as a Constant.
|
boolean |
hasField(String fldName)
Returns true if the scan has the specified field.
|
void |
insert()
Inserts a new record somewhere in the scan.
|
void |
moveToRecordId(RecordId rid)
Positions the scan so that the current record has the specified record ID
.
|
boolean |
next()
Moves the scan to the next record.
|
void |
setVal(String fldName,
Constant val)
Sets the value of the specified field, as a Constant.
|
public TableScan(TableInfo ti, Transaction tx)
ti - the table's metadatatx - the calling transactionpublic void beforeFirst()
ScanbeforeFirst in interface Scanpublic boolean next()
Scanpublic void close()
Scanpublic Constant getVal(String fldName)
getVal in interface RecordfldName - the name of the fieldRecord.getVal(java.lang.String)public boolean hasField(String fldName)
Scanpublic void setVal(String fldName, Constant val)
setVal in interface UpdateScanval - the constant to be set. Will be casted to the correct type
specified in the schema of the table.fldName - the name of the fieldUpdateScan.setVal(java.lang.String, Constant)public void delete()
UpdateScandelete in interface UpdateScanpublic void insert()
UpdateScaninsert in interface UpdateScanpublic RecordId getRecordId()
UpdateScangetRecordId in interface UpdateScanpublic void moveToRecordId(RecordId rid)
UpdateScanmoveToRecordId in interface UpdateScanrid - the RecordId of the desired recordCopyright © 2022 VanillaDB Organization. All rights reserved.