|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectheap.HeapFile
public class HeapFile
| Field Summary |
|---|
| Fields inherited from interface global.GlobalConst |
|---|
EMPTY_SLOT, FIRST_PAGEID, INVALID_PAGEID, MAX_COLSIZE, MAX_TUPSIZE, NAME_MAXLEN, PAGE_SIZE, PIN_DISKIO, PIN_MEMCPY, UNPIN_CLEAN, UNPIN_DIRTY |
| Constructor Summary | |
|---|---|
HeapFile(java.lang.String name)
If the given name already denotes a file, this opens it; otherwise, this creates a new empty file. |
|
| Method Summary | |
|---|---|
void |
deleteFile()
Deletes the heap file from the database, freeing all of its pages. |
void |
deleteRecord(RID rid)
Deletes the specified record from the heap file. |
int |
getRecCnt()
Gets the number of records in the file. |
RID |
insertRecord(byte[] record)
Inserts a new record into the file and returns its RID. |
HeapScan |
openScan()
Initiates a sequential scan of the heap file. |
byte[] |
selectRecord(RID rid)
Reads a record from the file, given its id. |
java.lang.String |
toString()
Returns the name of the heap file. |
void |
updateRecord(RID rid,
byte[] newRecord)
Updates the specified record in the heap file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HeapFile(java.lang.String name)
| Method Detail |
|---|
public void deleteFile()
public RID insertRecord(byte[] record)
java.lang.IllegalArgumentException - if the record is too largepublic byte[] selectRecord(RID rid)
java.lang.IllegalArgumentException - if the rid is invalid
public void updateRecord(RID rid,
byte[] newRecord)
java.lang.IllegalArgumentException - if the rid or new record is invalidpublic void deleteRecord(RID rid)
java.lang.IllegalArgumentException - if the rid is invalidpublic int getRecCnt()
public HeapScan openScan()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||