diff -r 576e7a2861ae -r 369903afbb29 src/main/java/de/uapcore/sudoku/DocumentHandler.java --- a/src/main/java/de/uapcore/sudoku/DocumentHandler.java Sat Jul 25 14:01:28 2020 +0200 +++ b/src/main/java/de/uapcore/sudoku/DocumentHandler.java Sat Jul 25 15:29:51 2020 +0200 @@ -32,12 +32,18 @@ /** * - * @author mike */ public class DocumentHandler { private String filename; - + + /** + * Loads data into the specified field. + * + * @param field the field to populated with the loaded data + * @throws IOException if loading fails or no file name has been set before + * @see #setFilename(String) + */ public void load(Field field) throws IOException { if (!isFilenameSet()) { throw new IOException("no filename supplied"); @@ -72,7 +78,14 @@ } field.setAllCellsModified(false); } - + + /** + * Saves the specified field to a file. + * + * @param field the field to save + * @throws IOException if saving fails or the file name has not been set before + * @see #setFilename(String) + */ public void save(Field field) throws IOException { if (!isFilenameSet()) { throw new IOException("no filename supplied"); @@ -89,15 +102,28 @@ } } } - + + /** + * Sets the file name for loading and saving data. + * + * @param filename the file name + */ public void setFilename(String filename) { this.filename = filename; } - + + /** + * Clears the file name. + */ public void clearFilename() { filename = null; } - + + /** + * Checks whether a file name has been set. + * + * @return true if a file name is known, false otherwise + */ public boolean isFilenameSet() { return filename != null; }