Package net.sf.tweety.commons
Class Writer
- java.lang.Object
-
- net.sf.tweety.commons.Writer
-
public abstract class Writer extends Object
This class represents an abstract writer for writing objects into the file system.- Author:
- Matthias Thimm, Anna Gessler
-
-
Method Summary
Modifier and Type Method Description ObjectgetObject()Returns the object of this writer.voidsetObject(Object obj)Sets the object of this writer.voidwriteToFile(String filename)Writes the object into the given file.abstract StringwriteToString()Writes the object into a string.
-
-
-
Constructor Detail
-
Writer
public Writer(Object obj)
Creates a new writer for the given object.- Parameters:
obj- an object.
-
-
Method Detail
-
setObject
public void setObject(Object obj)
Sets the object of this writer.- Parameters:
obj- some object
-
getObject
public Object getObject()
Returns the object of this writer.- Returns:
- the object of this writer.
-
writeToString
public abstract String writeToString()
Writes the object into a string.- Returns:
- the string representing the object.
-
writeToFile
public void writeToFile(String filename) throws IOException
Writes the object into the given file.- Parameters:
filename- the name of the file.- Throws:
IOException- if an IO issue occurs.
-
-