Class Writer

java.lang.Object
org.tweetyproject.commons.Writer
Direct Known Subclasses:
DefaultCondensedProbabilityDistributionWriter, DefaultProbabilityDistributionWriter, MlWriter, PlWriter

public abstract class Writer extends Object
This class represents an abstract writer for writing objects into the file system.
Author:
Matthias Thimm, Anna Gessler
  • Constructor Details

    • Writer

      public Writer(Object obj)
      Creates a new writer for the given object.
      Parameters:
      obj - an object.
    • Writer

      public Writer()
      Creates a new empty writer.
  • Method Details

    • setObjectToBePrinted

      public void setObjectToBePrinted(Object obj)
      Sets the object of this writer.
      Parameters:
      obj - some object
    • getObjectToBePrinted

      public Object getObjectToBePrinted()
      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.