Solved 3.2.1

This commit is contained in:
stiv2804 2019-02-14 14:01:42 +01:00
parent 4cc86d3c23
commit f202129510

View file

@ -54,6 +54,7 @@ public class ScoreEntry implements Comparable<ScoreEntry> {
*/
public void write(PrintWriter printWriter) {
// TODO: ScoreEntry#write(PrintWriter)
printWriter.println(this.name + ";" + this.date + ";" + this.score + ";" + this.gameType);
}
/**
@ -73,8 +74,11 @@ public class ScoreEntry implements Comparable<ScoreEntry> {
* @return Ein ScoreEntry-Objekt oder null
*/
public static ScoreEntry read(String line) {
// TODO: ScoreEntry#read(String)
String[] parts = line.split(";");
if(parts.length != 4)
return null;
ScoreEntry res = new ScoreEntry(parts[0], Integer.parseInt(parts[1]), new Date(Long.parseLong(parts[2])), parts[3]);
return res;
}
public Date getDate() {