global
Class RID

java.lang.Object
  extended by global.RID

public class RID
extends java.lang.Object

A record is uniquely identified by its page number and slot number.


Field Summary
 PageId pageno
          The record's page number.
 int slotno
          The record's slot number.
 
Constructor Summary
RID()
          Default constructor.
RID(byte[] data, short offset)
          Constructs an RID stored in the given data buffer.
RID(PageId pageno, int slotno)
          Constructs an RID from the given values.
RID(RID rid)
          Copy constructor.
 
Method Summary
 void copyRID(RID rid)
          Makes a copy of the given RID.
 boolean equals(java.lang.Object obj)
          True if obj is an RID with the same values; false otherwise.
 short getLength()
          Gets the total length of the RID (in bytes).
 int hashCode()
          Returns a hash code value for the RID.
 java.lang.String toString()
          Returns a string representation of the PageId.
 void writeData(byte[] data, short offset)
          Writes the RID into the given data buffer.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

pageno

public PageId pageno
The record's page number.


slotno

public int slotno
The record's slot number.

Constructor Detail

RID

public RID()
Default constructor.


RID

public RID(RID rid)
Copy constructor.


RID

public RID(PageId pageno,
           int slotno)
Constructs an RID from the given values.


RID

public RID(byte[] data,
           short offset)
Constructs an RID stored in the given data buffer.

Method Detail

writeData

public void writeData(byte[] data,
                      short offset)
Writes the RID into the given data buffer.


getLength

public short getLength()
Gets the total length of the RID (in bytes).


copyRID

public void copyRID(RID rid)
Makes a copy of the given RID.


hashCode

public int hashCode()
Returns a hash code value for the RID.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
True if obj is an RID with the same values; false otherwise.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of the PageId.

Overrides:
toString in class java.lang.Object