DLV.io
Class RandomAccessLiteralFile

java.lang.Object
  extended by DLV.io.RandomAccessLiteralFile
Direct Known Subclasses:
LiteralFile

public abstract class RandomAccessLiteralFile
extends java.lang.Object

This is an abstract class that implements a random access file of literals.

Version:
3.1
Author:
Francesco Ricca

Constructor Summary
RandomAccessLiteralFile()
           
 
Method Summary
static RandomAccessLiteralFile buildLiteralFile(java.lang.String file, java.lang.String encoding, int cacheSize, int lowLevelBufferSize)
          Builds an instance of RandomAccessLiteralFile that works on a datalog text file.
abstract  void close()
          Close the file.
abstract  void flush()
          Flushes buffers.
abstract  java.lang.String getName()
          Returns the name of the file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAccessLiteralFile

public RandomAccessLiteralFile()
Method Detail

buildLiteralFile

public static RandomAccessLiteralFile buildLiteralFile(java.lang.String file,
                                                       java.lang.String encoding,
                                                       int cacheSize,
                                                       int lowLevelBufferSize)
                                                throws java.io.IOException
Builds an instance of RandomAccessLiteralFile that works on a datalog text file.
Current implementation has the following features:
- implements a clock buffer of literals (works like virtual memory clock algorithm).
- implements a simple mutex concurrecy control.
- can be used in several FilePredicate instances.

Parameters:
file - a string containing the full pathname of the text file.
encoding - The name of a supported character encoding (RandomAccessCharacterFile).
the - size of the literal cache size.
the - size of the lower level character buffer.
Returns:
An instance of RandomAccessLiteralFile that works on a datalog text file.
Throws:
java.io.IOException - If an I/O error occurs.
See Also:
FilePredicate, RandomAccessLiteralFile

close

public abstract void close()
                    throws java.io.IOException
Close the file.

Throws:
java.io.IOException - If an I/O error occurs.

flush

public abstract void flush()
                    throws java.io.IOException
Flushes buffers.

Throws:
java.io.IOException - If an I/O error occurs.

getName

public abstract java.lang.String getName()
Returns the name of the file.

Returns:
The name of the file..