Class DlgpWriter
java.lang.Object
fr.inria.rules.integraal.io.dlgp.DlgpWriter
- All Implemented Interfaces:
Writer, Closeable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor writing in the standard outputDlgpWriter(File file) Creates a writer that writes to the supplied file.DlgpWriter(Writer writer) Constructor writing with the given writerDlgpWriter(String filepath) Creates a writer that writes to the supplied file path. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Flush the writer if possiblevoidWrite the given formula as DLGP For now, only conjunction is handled (and flattened)voidWrite the given fb as DLGPvoidwrite(KnowledgeBase kb) Write the given kb as DLGPvoidWrite the given rb as DLGPvoidWrite the given atom as DLGPvoidWrite the given constant as DLGPvoidWrite the given evaluable function as DLGPvoidWrite the given literal as DLGP.voidWrite the given functional term as DLGP.voidWrite the given predicate as DLGPvoidWrite the given term as DLGPvoidWrite the given variable as DLGPvoidWrite the given query as DLGPvoidWrite the given rule as DLGPvoidWrite the given object if possiblevoidWrite the given stringvoidWrite the given stream of atoms, treated as a conjunction, in DLGPvoidwriteConjunction(Collection<Atom> atoms) Write the given atoms as a single conjunction as DLGP
-
Constructor Details
-
DlgpWriter
public DlgpWriter()Default constructor writing in the standard output -
DlgpWriter
Constructor writing with the given writer- Parameters:
writer- the writer to use
-
DlgpWriter
Creates a writer that writes to the supplied file.- Parameters:
file- file to write into- Throws:
IOException- if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
-
DlgpWriter
Creates a writer that writes to the supplied file path.- Parameters:
filepath- filepath to write into- Throws:
IOException- if the file path exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
flush
Description copied from interface:WriterFlush the writer if possible- Specified by:
flushin interfaceWriter- Throws:
IOException- If an I/O error occurs
-
write
Description copied from interface:WriterWrite the given object if possible- Specified by:
writein interfaceWriter- Parameters:
object- object to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given string- Parameters:
str- string to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given kb as DLGP- Parameters:
kb- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given fb as DLGP- Parameters:
fb- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given stream of atoms, treated as a conjunction, in DLGP- Parameters:
atoms- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given rb as DLGP- Parameters:
rb- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given rule as DLGP- Parameters:
rule- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given query as DLGP- Parameters:
query- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given formula as DLGP For now, only conjunction is handled (and flattened)- Parameters:
formula- to write- Throws:
IOException- If an I/O error occurs
-
writeConjunction
Write the given atoms as a single conjunction as DLGP- Parameters:
atoms- conjunction to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given atom as DLGP- Parameters:
atom- to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given predicate as DLGP- Parameters:
p- predicate to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given term as DLGP- Parameters:
t- term to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given evaluable function as DLGP- Parameters:
ef- evaluable function to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given variable as DLGP- Parameters:
v- variable to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given literal as DLGP. This is not yet fully implemented.
Actually handles Integer, Double and Boolean. Other types are written as String.
In order to add more types, you can extend this method.- Parameters:
l- literal to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given functional term as DLGP. This is not yet fully implemented.
The computed prefix is not added back !- Parameters:
f- functional term to write- Throws:
IOException- If an I/O error occurs
-
write
Write the given constant as DLGP- Parameters:
c- constant to write- Throws:
IOException- If an I/O error occurs
-