Class Block

  • Direct Known Subclasses:
    FileListBlock, IndexBlock

    public abstract class Block
    extends Object
    A block is a container that can hold information (a list of file names, a list of words, ...), be saved on the disk and loaded in memory.
    • Field Detail

      • blockSize

        protected int blockSize
        Size of the block
      • field

        protected Field field
        Field in which the information is stored
    • Constructor Detail

      • Block

        public Block​(int blockSize)
    • Method Detail

      • read

        public void read​(RandomAccessFile raf,
                         int blockNum)
                  throws IOException
        Loads the block with the given number in memory, reading it from a RandomAccessFile.
        Throws:
        IOException