Package org.tweetyproject.commons
Class Writer
java.lang.Object
org.tweetyproject.commons.Writer
- Direct Known Subclasses:
DefaultCondensedProbabilityDistributionWriter
,DefaultProbabilityDistributionWriter
,MlWriter
,PlWriter
This class represents an abstract writer for
writing objects into the file system.
- Author:
- Matthias Thimm, Anna Gessler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the object of this writer.void
Sets the object of this writer.void
writeToFile
(String filename) Writes the object into the given file.abstract String
Writes the object into a string.
-
Constructor Details
-
Writer
Creates a new writer for the given object.- Parameters:
obj
- an object.
-
Writer
public Writer()Creates a new empty writer.
-
-
Method Details
-
setObjectToBePrinted
Sets the object of this writer.- Parameters:
obj
- some object
-
getObjectToBePrinted
Returns the object of this writer.- Returns:
- the object of this writer.
-
writeToString
Writes the object into a string.- Returns:
- the string representing the object.
-
writeToFile
Writes the object into the given file.- Parameters:
filename
- the name of the file.- Throws:
IOException
- if an IO issue occurs.
-