DLV.io
Class LiteralFile

java.lang.Object
  extended by DLV.io.RandomAccessLiteralFile
      extended by DLV.io.LiteralFile

public class LiteralFile
extends RandomAccessLiteralFile

Implements a file of Literals.

Since:
3.0
Version:
0.0
Author:
Francesco Ricca

Nested Class Summary
static class LiteralFile.LiteralHandler
           
 
Constructor Summary
LiteralFile(java.lang.String file, java.lang.String encoding, int cacheSize, int lowLevelBufferSize)
           
 
Method Summary
 void addLiteralHandler(LiteralFile.LiteralHandler lh)
           
 void close()
          Close the file.
 void flush()
          Flushes buffers.
 LiteralFile.LiteralHandler getLiteralHandler(long lgPosition)
           
 java.lang.String getName()
          Returns the name of the file.
 int indexOfLiteral(LiteralFile.LiteralHandler lh)
           
 LiteralFile.LiteralHandler indexOfLiteralHandler(LiteralFile.LiteralHandler lh)
           
static void main(java.lang.String[] ars)
           
 void removeLiteralHandler(long lgPosition)
           
 void setLiteralHandler(long lgPosition, LiteralFile.LiteralHandler lh)
           
 long size()
           
 
Methods inherited from class DLV.io.RandomAccessLiteralFile
buildLiteralFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiteralFile

public LiteralFile(java.lang.String file,
                   java.lang.String encoding,
                   int cacheSize,
                   int lowLevelBufferSize)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getName

public java.lang.String getName()
Description copied from class: RandomAccessLiteralFile
Returns the name of the file.

Specified by:
getName in class RandomAccessLiteralFile
Returns:
The name of the file..

size

public long size()

close

public void close()
           throws java.io.IOException
Description copied from class: RandomAccessLiteralFile
Close the file.

Specified by:
close in class RandomAccessLiteralFile
Throws:
java.io.IOException - If an I/O error occurs.

getLiteralHandler

public LiteralFile.LiteralHandler getLiteralHandler(long lgPosition)
                                             throws java.io.IOException
Throws:
java.io.IOException

setLiteralHandler

public void setLiteralHandler(long lgPosition,
                              LiteralFile.LiteralHandler lh)
                       throws java.io.IOException
Throws:
java.io.IOException

addLiteralHandler

public void addLiteralHandler(LiteralFile.LiteralHandler lh)
                       throws java.io.IOException
Throws:
java.io.IOException

removeLiteralHandler

public void removeLiteralHandler(long lgPosition)
                          throws java.io.IOException
Throws:
java.io.IOException

indexOfLiteral

public int indexOfLiteral(LiteralFile.LiteralHandler lh)
                   throws java.io.IOException
Throws:
java.io.IOException

indexOfLiteralHandler

public LiteralFile.LiteralHandler indexOfLiteralHandler(LiteralFile.LiteralHandler lh)
                                                 throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Description copied from class: RandomAccessLiteralFile
Flushes buffers.

Specified by:
flush in class RandomAccessLiteralFile
Throws:
java.io.IOException - If an I/O error occurs.

main

public static void main(java.lang.String[] ars)