All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class heap.Scan

java.lang.Object
   |
   +----heap.Scan

public class Scan
extends Object
implements GlobalConst
A Scan object is created ONLY through the function openScan of a HeapFile. It supports the getNext interface which will simply retrieve the next record in the heapfile. An object of type scan will always have pinned one directory page of the heapfile.


Constructor Index

 o Scan(Heapfile)
The constructor pins the first directory page in the file and initializes its private data members from the private data member from hf

Method Index

 o closescan()
Closes the Scan object
 o getNext(RID)
Retrieve the next record in a sequential scan
 o position(RID)
Position the scan cursor to the record with the given rid.

Constructors

 o Scan
 public Scan(Heapfile hf) throws InvalidTupleSizeException, IOException
The constructor pins the first directory page in the file and initializes its private data members from the private data member from hf

Parameters:
hf - A HeapFile object
Throws: InvalidTupleSizeException
Invalid tuple size
Throws: IOException
I/O errors

Methods

 o getNext
 public Tuple getNext(RID rid) throws InvalidTupleSizeException, IOException
Retrieve the next record in a sequential scan

Parameters:
rid - Record ID of the record
Returns:
the Tuple of the retrieved record.
Throws: InvalidTupleSizeException
Invalid tuple size
Throws: IOException
I/O errors
 o position
 public boolean position(RID rid) throws InvalidTupleSizeException, IOException
Position the scan cursor to the record with the given rid.

Parameters:
rid - Record ID of the given record
Returns:
true if successful, false otherwise.
Throws: InvalidTupleSizeException
Invalid tuple size
Throws: IOException
I/O errors
 o closescan
 public void closescan()
Closes the Scan object


All Packages  Class Hierarchy  This Package  Previous  Next  Index