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()
Scan
beforeFirst
in interface Scan
public boolean next()
Scan
public void close()
Scan
public Constant getVal(String fldName)
getVal
in interface Record
fldName
- the name of the fieldRecord.getVal(java.lang.String)
public boolean hasField(String fldName)
Scan
public void setVal(String fldName, Constant val)
setVal
in interface UpdateScan
val
- 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()
UpdateScan
delete
in interface UpdateScan
public void insert()
UpdateScan
insert
in interface UpdateScan
public RecordId getRecordId()
UpdateScan
getRecordId
in interface UpdateScan
public void moveToRecordId(RecordId rid)
UpdateScan
moveToRecordId
in interface UpdateScan
rid
- the RecordId of the desired recordCopyright © 2022 VanillaDB Organization. All rights reserved.