Class Writer

    • Constructor Summary

      Constructors 
      Constructor Description
      Writer()
      Creates a new empty writer.
      Writer​(java.lang.Object obj)
      Creates a new writer for the given object.
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object getObjectToBePrinted()
      Returns the object of this writer.
      void setObjectToBePrinted​(java.lang.Object obj)
      Sets the object of this writer.
      void writeToFile​(java.lang.String filename)
      Writes the object into the given file.
      abstract java.lang.String writeToString()
      Writes the object into a string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Writer

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

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

      • setObjectToBePrinted

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

        public java.lang.Object getObjectToBePrinted()
        Returns the object of this writer.
        Returns:
        the object of this writer.
      • writeToString

        public abstract java.lang.String writeToString()
        Writes the object into a string.
        Returns:
        the string representing the object.
      • writeToFile

        public void writeToFile​(java.lang.String filename)
                         throws java.io.IOException
        Writes the object into the given file.
        Parameters:
        filename - the name of the file.
        Throws:
        java.io.IOException - if an IO issue occurs.