Package view.output

Class FileWriterWrapper

java.lang.Object
view.output.AFileWriter
view.output.FileWriterWrapper

public class FileWriterWrapper
extends AFileWriter
FileWriterWrapper member of class adapter pattern (adapter). Maps the desired behavior to the target.
  • Field Summary

    Fields inherited from class view.output.AFileWriter

    fileWriter
  • Constructor Summary

    Constructors
    Constructor Description
    FileWriterWrapper​(java.io.File file)
    Constructor of FileWriterWrapper delegates to constructor of AFileWriter.
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close function for closing a file.
    void write​(java.lang.String content)
    Write function for writing to a file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileWriterWrapper

      public FileWriterWrapper​(java.io.File file)
      Constructor of FileWriterWrapper delegates to constructor of AFileWriter.
      Parameters:
      file - to be written to.
  • Method Details

    • write

      public void write​(java.lang.String content)
      Description copied from class: AFileWriter
      Write function for writing to a file. Exceptions are handled and the buffer gets flushed after every call to ensure the file to be written to even if it is not closed properly.
      Specified by:
      write in class AFileWriter
    • close

      public void close()
      Description copied from class: AFileWriter
      Close function for closing a file. Exceptions are handled.
      Specified by:
      close in class AFileWriter