org.teiid.internal.core.index
Class Block

java.lang.Object
  extended by org.teiid.internal.core.index.Block
Direct Known Subclasses:
FileListBlock, IndexBlock

public abstract class Block
extends java.lang.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 Summary
protected  int blockSize
          Size of the block
protected  Field field
          Field in which the information is stored
 
Constructor Summary
Block(int blockSize)
           
 
Method Summary
 void clear()
          Empties the block.
 void flush()
          Flushes the block
 void read(java.io.RandomAccessFile raf, int blockNum)
          Loads the block with the given number in memory, reading it from a RandomAccessFile.
 void write(java.io.RandomAccessFile raf, int blockNum)
          Writes the block in a RandomAccessFile, giving it a block number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

clear

public void clear()
Empties the block.


flush

public void flush()
Flushes the block


read

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

Throws:
java.io.IOException

write

public void write(java.io.RandomAccessFile raf,
                  int blockNum)
           throws java.io.IOException
Writes the block in a RandomAccessFile, giving it a block number.

Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.