// File: Block.java // // Author: Andrew H. Fagg // 11/15/2 // // Basic structure + constants for our disk blocks. // Subclasses define the specifics of how the bytes within a block are used // // To Do: nothing // import java.util.*; import java.lang.*; import java.io.*; abstract class Block { // These constants assume a block size of 1024 final public int nameSize = 20; // Maximum length of file/dir name public short nextBlkPtr; // Pointer to the next file block or free block (vs) final public int maxFiles = 36; // Maximum number of files/dir in (vs) // a directory public int block_num; // Set by the read method public Disk disk; // Reference to the disk object // Must be defined by each block type abstract public void write(int block) throws FileSystemException; abstract public void read(int block) throws FileSystemException; };