|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDLV.Predicate
DLV.FilePredicate
This class allows to handle ground predicates stored in a text file in datalog format.
This class allows to modify or delete literals stored in text files by using objects.
By using a RandomAccessLiteralFile it allows to manipulate text files in datalog format like
one does for literals storedin memory or in a database table.
Please note that FilePredcates are Predicates, the only difference is the storage device used to store EDB.
The same RandomAccessLiteralFile can be shared by several FilePredicate instances, the library does non support
any kind of control, the programmer must ensure that for a given RandomAccessLiteralFile there exist only one
FilePredicate that handles a given Predate.
Es.
FilePredicate f1 handles exmaple(_,_) relation on ex.dl file and FilePredicate f2 handles exmaple1(_,_) relation on ex.dl file is OK.
FilePredicate f1 handles exmaple(_,_) relation on ex.dl file and FilePredicate f2 handles exmaple(_,_) relation on ex.dl file can be DANGEROUS (race conditions may occur) and must be avoided..
The JDBCPredicate class never closes the underlying RandomAccessLiteralFile, you must take care of this fact.
Note that you can save DLV output in a text file specifying a give FilePredicate as output storage devices by using (OutputDescriptor
) classes.
Predicate
,
JDBCPredicate
,
DlvHandler
,
Model
,
java.sql.ResultSet
,
java.sql.Statement
,
OutputDescriptor
Nested Class Summary |
Nested classes inherited from class DLV.Predicate |
Predicate.Literal |
Constructor Summary | |
FilePredicate(java.lang.String name,
int arity,
DLV.io.RandomAccessLiteralFile file)
Constructs a new FilePredicate instance. |
|
FilePredicate(java.lang.String name,
int arity,
java.lang.String pathname)
Constructs a new FilePredicate instance. |
|
FilePredicate(java.lang.String name,
int arity,
java.lang.String pathname,
java.lang.String encoding,
int cacheSize,
int lowerLevelBufferSize)
Constructs a new FilePredicate instance. |
Method Summary | |
void |
flush()
This method calls the flush() method of the underlying RandomAccessLiteralFile. |
DLV.io.RandomAccessLiteralFile |
getRandomAccessLiteralFile()
Returns the underlying RandomAccessLiteralFile. |
void |
setRandomAccessLiteralFile(DLV.io.RandomAccessLiteralFile file)
Changes the underlying RandomAccessLiteralFile. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FilePredicate(java.lang.String name, int arity, java.lang.String pathname) throws java.io.IOException
name
- Is the name of this predicate.arity
- Is the arity of this predicate.pathname
- Is the full pathname of a text file in datalog format.
java.lang.NullPointerException
- If "name" or "pathname" are null.
java.io.IOException
public FilePredicate(java.lang.String name, int arity, java.lang.String pathname, java.lang.String encoding, int cacheSize, int lowerLevelBufferSize) throws java.io.IOException
name
- Is the name of this predicate.arity
- Is the arity of this predicate.pathname
- Is the full pathname of a text file in datalog format.encoding
- The name of a supported character encoding (RandomAccessCharacterFile
).cacheSize
- The size of the literal cache size (RandomAccessLiteralFile
).lowerLevelBufferSize
- The size of the lower level character buffer (RandomAccessCharacterFile
).
java.lang.NullPointerException
- If "name" or "pathname" are null.
java.io.IOException
- If an I/O error occurs.public FilePredicate(java.lang.String name, int arity, DLV.io.RandomAccessLiteralFile file) throws java.io.IOException
name
- Is the name of this predicate.arity
- Is the arity of this predicate.file
- a RandomAccessLiteralFile.
java.lang.NullPointerException
- If "name" or "pathname" are null.
java.io.IOException
- If an I/O error occurs.Method Detail |
public DLV.io.RandomAccessLiteralFile getRandomAccessLiteralFile()
public void setRandomAccessLiteralFile(DLV.io.RandomAccessLiteralFile file) throws java.io.IOException
file
- a RandomAccessLiteralFile.
throws NullPointerException If "file" is null.
java.io.IOException
- If an I/O error occurs.public void flush() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |