simpledb
Interface PageId

All Known Implementing Classes:
HeapPageId

public interface PageId

PageId is an interface to a specific page of a specific table.


Method Summary
 boolean equals(java.lang.Object o)
          Compares one PageId to another.
 int getTableId()
           
 int hashCode()
           
 int pageNumber()
           
 int[] serialize()
          Return a representation of this page id object as a collection of integers (used for logging) This class MUST have a constructor that accepts n integer parameters, where n is the number of integers returned in the array from serialize.
 

Method Detail

serialize

int[] serialize()
Return a representation of this page id object as a collection of integers (used for logging) This class MUST have a constructor that accepts n integer parameters, where n is the number of integers returned in the array from serialize.


getTableId

int getTableId()
Returns:
the unique tableid hashcode with this PageId

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this page, represented by the concatenation of the table number and the page number (needed if a PageId is used as a key in a hash table in the BufferPool, for example.)
See Also:
BufferPool

equals

boolean equals(java.lang.Object o)
Compares one PageId to another.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare against (must be a PageId)
Returns:
true if the objects are equal (e.g., page numbers and table ids are the same)

pageNumber

int pageNumber()