DLV
Class ODIFilePredicate

java.lang.Object
  extended byDLV.OutputDescriptorItem
      extended byDLV.ODIFilePredicate

public class ODIFilePredicate
extends OutputDescriptorItem

This class allows to specify that the output storage device are one or more text files in datalog format. MultipleModel generation is supported if you specify a filename and is not supported if you specify a RandomAccessLiteralFile. If DLV outputs more than one model and you specified "file.dl" file name the following files will be built:
file.dl // containing the first model.
file.dl.1 // containing the second model.
...
file.dl.n // containing the (n+1)-th model.

Each text file is handled by a FilePredicate contained in the corresponding Model Object.

See Also:
OutputDescriptor, OutputDescriptorItem, RandomAccessLiteralFile, RandomAccessCharacterFile

Constructor Summary
ODIFilePredicate(DLV.io.RandomAccessLiteralFile rFile)
          Builds an ODIFilePredicate given a RandomAccessLiteralFile.
ODIFilePredicate(java.lang.String fileName)
          Builds an ODIFilePredicate given a file name.
ODIFilePredicate(java.lang.String fileName, java.lang.String encoding)
          Builds an ODIFilePredicate given a file name and a supported character encoding.
ODIFilePredicate(java.lang.String fileName, java.lang.String encoding, int cacheSize)
          Builds an ODIFilePredicate given a file name, a supported character encoding and the literal cache size.
ODIFilePredicate(java.lang.String fileName, java.lang.String encoding, int cacheSize, int lowLevelBufferSize)
          Builds an ODIFilePredicate given a file name, a supported character encoding, the literal cache size, and the character buffer size.
 
Method Summary
 Predicate buildPredicate(java.lang.String name, int arity, Model m, int modelNumber)
           
 void flushAndClean()
           
 boolean multipleModelAllowed()
          Returns true if this OutputDescriptorItem supports multiple model generation, false otherwise.
 
Methods inherited from class DLV.OutputDescriptorItem
getReplace, setReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ODIFilePredicate

public ODIFilePredicate(java.lang.String fileName,
                        java.lang.String encoding,
                        int cacheSize,
                        int lowLevelBufferSize)
Builds an ODIFilePredicate given a file name, a supported character encoding, the literal cache size, and the character buffer size.

Parameters:
fileName - A valid pathname.
encoding - A supported character encoding.
cacheSize - the literal cache size.
lowLevelBufferSize - the character buffer size.
See Also:
RandomAccessLiteralFile

ODIFilePredicate

public ODIFilePredicate(java.lang.String fileName,
                        java.lang.String encoding,
                        int cacheSize)
Builds an ODIFilePredicate given a file name, a supported character encoding and the literal cache size.

Parameters:
fileName - A valid pathname.
encoding - A supported character encoding.
cacheSize - the literal cache size.
See Also:
RandomAccessLiteralFile

ODIFilePredicate

public ODIFilePredicate(java.lang.String fileName,
                        java.lang.String encoding)
Builds an ODIFilePredicate given a file name and a supported character encoding.

Parameters:
fileName - A valid pathname.
encoding - A supported character encoding.
See Also:
RandomAccessLiteralFile

ODIFilePredicate

public ODIFilePredicate(java.lang.String fileName)
Builds an ODIFilePredicate given a file name.

Parameters:
fileName - A valid pathname.

ODIFilePredicate

public ODIFilePredicate(DLV.io.RandomAccessLiteralFile rFile)
Builds an ODIFilePredicate given a RandomAccessLiteralFile.
multiple model are not allowed

Parameters:
rFile - An open RandomAccessLiteralFile instance.
Method Detail

multipleModelAllowed

public boolean multipleModelAllowed()
Description copied from class: OutputDescriptorItem
Returns true if this OutputDescriptorItem supports multiple model generation, false otherwise. Predicate and in most cases FilePredicate supports multiple models in output, but obviously JDBCPredicate does not allow to export more than one model.

Overrides:
multipleModelAllowed in class OutputDescriptorItem
Returns:
true if this OutputDescriptor supports multiple model generation, false otherwise.
See Also:
OutputDescriptorItem

buildPredicate

public Predicate buildPredicate(java.lang.String name,
                                int arity,
                                Model m,
                                int modelNumber)
Specified by:
buildPredicate in class OutputDescriptorItem

flushAndClean

public void flushAndClean()
Specified by:
flushAndClean in class OutputDescriptorItem