|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimpledb.query.TableScan
public class TableScan
The Scan class corresponding to a table. A table scan is just a wrapper for a RecordFile object; most methods just delegate to the corresponding RecordFile methods.
Constructor Summary | |
---|---|
TableScan(TableInfo ti,
Transaction tx)
Creates a new table scan, and opens its corresponding record file. |
Method Summary | |
---|---|
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. |
int |
getInt(String fldname)
Returns the value of the specified integer field in the current record. |
RID |
getRid()
Returns the RID of the current record. |
String |
getString(String fldname)
Returns the value of the specified string field in 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 |
moveToRid(RID rid)
Positions the scan so that the current record has the specified RID. |
boolean |
next()
Moves the scan to the next record. |
void |
setInt(String fldname,
int val)
Modifies the field value of the current record. |
void |
setString(String fldname,
String val)
Modifies the field value of the current record. |
void |
setVal(String fldname,
Constant val)
Sets the value of the specified field, as a Constant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableScan(TableInfo ti, Transaction tx)
ti
- the table's metadatatx
- the calling transactionMethod Detail |
---|
public void beforeFirst()
Scan
beforeFirst
in interface Scan
public boolean next()
Scan
next
in interface Scan
public void close()
Scan
close
in interface Scan
public Constant getVal(String fldname)
getVal
in interface Scan
fldname
- the name of the field
Scan.getVal(java.lang.String)
public int getInt(String fldname)
Scan
getInt
in interface Scan
fldname
- the name of the field
public String getString(String fldname)
Scan
getString
in interface Scan
fldname
- the name of the field
public boolean hasField(String fldname)
Scan
hasField
in interface Scan
fldname
- the name of the field
public void setVal(String fldname, Constant val)
setVal
in interface UpdateScan
fldname
- the name of the fieldval
- the new value, expressed as a ConstantUpdateScan.setVal(java.lang.String, simpledb.query.Constant)
public void setInt(String fldname, int val)
UpdateScan
setInt
in interface UpdateScan
fldname
- the name of the fieldval
- the new integer valuepublic void setString(String fldname, String val)
UpdateScan
setString
in interface UpdateScan
fldname
- the name of the fieldval
- the new string valuepublic void delete()
UpdateScan
delete
in interface UpdateScan
public void insert()
UpdateScan
insert
in interface UpdateScan
public RID getRid()
UpdateScan
getRid
in interface UpdateScan
public void moveToRid(RID rid)
UpdateScan
moveToRid
in interface UpdateScan
rid
- the RID of the desired record
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |