Solved 3.2.1
This commit is contained in:
parent
4cc86d3c23
commit
f202129510
1 changed files with 99 additions and 95 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue