Formatted all files to the same standard

This commit is contained in:
matthew
2014-10-08 13:42:12 +01:00
parent 53a2a8b150
commit 3da9ad5469
151 changed files with 952 additions and 870 deletions
@@ -5,72 +5,74 @@ import java.io.File;
import java.io.FileReader;
/**
* Every instance of this class represents the Model component
* in the Model-View-Presenter architectural pattern.
* Every instance of this class represents the Model component in the
* Model-View-Presenter architectural pattern.
*
* It is responsible for reading and loading the contents of a given file.
*/
public class FileLoader {
/**
* Indicates if the file is loaded or not.
*/
private boolean loaded = false;
/**
* The name of the file that we want to load.
*/
private String fileName;
/**
* Loads the data of the file specified.
*/
public String loadData() {
try {
BufferedReader br = new BufferedReader(new FileReader(new File(this.fileName)));
BufferedReader br = new BufferedReader(new FileReader(new File(
this.fileName)));
String text = "";
String line = "";
while( (line = br.readLine()) != null ) {
while ((line = br.readLine()) != null) {
text += line + "\n";
}
this.loaded = true;
br.close();
return text;
}
catch(Exception e) {
catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* Sets the path of the file to be loaded, to the given value.
*
* @param fileName The path of the file to be loaded.
* @param fileName
* The path of the file to be loaded.
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* @return fileName The path of the file to be loaded.
*/
public String getFileName() {
return this.fileName;
}
/**
* @return True, if the file given exists, false otherwise.
*/
public boolean fileExists() {
return new File(this.fileName).exists();
}
/**
* @return True, if the file is loaded, false otherwise.
*/