global
Class Page

java.lang.Object
  extended by global.Page
All Implemented Interfaces:
GlobalConst
Direct Known Subclasses:
HFPage

public class Page
extends java.lang.Object
implements GlobalConst

Lowest-level view of a disk page.


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
Page()
          Default constructor; creates a blank page.
Page(byte[] data)
          Constructor that wraps the given byte array.
 
Method Summary
 void copyPage(Page page)
          Copies the contents of the given page's buffer into this page's buffer.
 char getCharValue(int offset)
          Gets a char at the given page offset.
 byte[] getData()
          Get accessor for the data byte array.
 float getFloatValue(int offset)
          Gets a float at the given page offset.
 int getIntValue(int offset)
          Gets an int at the given page offset.
 short getShortValue(int offset)
          Gets a short at the given page offset.
 java.lang.String getStringValue(int offset, int length)
          Gets a string at the given page offset, given the maximum length.
 void setCharValue(char value, int offset)
          Sets a char at the given page offset.
 void setData(byte[] data)
          Set accessor for the data byte array.
 void setFloatValue(float value, int offset)
          Sets a float at the given page offset.
 void setIntValue(int value, int offset)
          Sets an int at the given page offset.
 void setPage(Page page)
          Sets this page's data array to share the given page's data array.
 void setShortValue(short value, int offset)
          Sets a short at the given page offset.
 void setStringValue(java.lang.String value, int offset)
          Sets a string at the given page offset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Page

public Page()
Default constructor; creates a blank page.


Page

public Page(byte[] data)
Constructor that wraps the given byte array.

Method Detail

getData

public byte[] getData()
Get accessor for the data byte array.


setData

public void setData(byte[] data)
Set accessor for the data byte array.

Throws:
java.lang.IllegalArgumentException - if the data array size is invalid

setPage

public void setPage(Page page)
Sets this page's data array to share the given page's data array.


copyPage

public void copyPage(Page page)
Copies the contents of the given page's buffer into this page's buffer.


getCharValue

public char getCharValue(int offset)
Gets a char at the given page offset.


setCharValue

public void setCharValue(char value,
                         int offset)
Sets a char at the given page offset.


getShortValue

public short getShortValue(int offset)
Gets a short at the given page offset.


setShortValue

public void setShortValue(short value,
                          int offset)
Sets a short at the given page offset.


getIntValue

public int getIntValue(int offset)
Gets an int at the given page offset.


setIntValue

public void setIntValue(int value,
                        int offset)
Sets an int at the given page offset.


getFloatValue

public float getFloatValue(int offset)
Gets a float at the given page offset.


setFloatValue

public void setFloatValue(float value,
                          int offset)
Sets a float at the given page offset.


getStringValue

public java.lang.String getStringValue(int offset,
                                       int length)
Gets a string at the given page offset, given the maximum length.


setStringValue

public void setStringValue(java.lang.String value,
                           int offset)
Sets a string at the given page offset.