Class ChaosGameFileHandler

java.lang.Object
edu.ntnu.stud.chaosgame.controller.utility.ChaosGameFileHandler

public class ChaosGameFileHandler extends Object
Class for handling the reading and writing of chaos game files.
  • Constructor Details

    • ChaosGameFileHandler

      public ChaosGameFileHandler()
  • Method Details

    • readFromFile

      public ChaosGameDescription readFromFile(String path)
      Creates a ChaosGameDescription based on the file found at the input path.
      Parameters:
      path - A String input which gives the path to a file describing a chaos game.
      Returns:
      A ChaosGameDescription description of a chaos game.
    • writeToFile

      public void writeToFile(ChaosGameDescription description, String path) throws IOException
      Reads from a file.
      Parameters:
      description - A ChaosGameDescription description of the chaos game that should be written to file.
      path - A String describing the path to the file that should be written to.
      Throws:
      IOException - if the file cannot be written to.