simpledb.file
Class Block

java.lang.Object
  extended by simpledb.file.Block

public class Block
extends Object

A reference to a disk block. A Block object consists of a filename and a block number. It does not hold the contents of the block; instead, that is the job of a Page object.

Author:
Edward Sciore

Constructor Summary
Block(String filename, int blknum)
          Constructs a block reference for the specified filename and block number.
 
Method Summary
 boolean equals(Object obj)
           
 String fileName()
          Returns the name of the file where the block lives.
 int hashCode()
           
 int number()
          Returns the location of the block within the file.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Block

public Block(String filename,
             int blknum)
Constructs a block reference for the specified filename and block number.

Parameters:
filename - the name of the file
blknum - the block number
Method Detail

fileName

public String fileName()
Returns the name of the file where the block lives.

Returns:
the filename

number

public int number()
Returns the location of the block within the file.

Returns:
the block number

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011. All Rights Reserved.