1
0
Fork 0

Strukturanpassung in Persistenz.java

Philipp Kotte 2023-10-11 17:04:28 +02:00
parent 330548712e
commit 253f29e2a8
1 changed files with 40 additions and 3 deletions

View File

@ -12,11 +12,31 @@ import java.io.*;
public class Persistenz { public class Persistenz {
final static String FILE_NAME = "WIZARD_DATA_"; /*------------------------------------------*/
// statische Konstanten
/*------------------------------------------*/
public static boolean sindDatenVorhanden(String name){ /*------------------------------------------*/
// statische Attribute(zB. zähler)
/*------------------------------------------*/
final static String FILE_NAME = "WIZARD_DATA_";
/*------------------------------------------*/
// Attribute jedes Objektes
/*------------------------------------------*/
/*------------------------------------------*/
// Konstruktoren (default und spezifische)
/*------------------------------------------*/
/*------------------------------------------*/
// statische Methoden
/*------------------------------------------*/
public static boolean sindDatenVorhanden(String name) {
File f = new File(FILE_NAME + name + ".ser"); File f = new File(FILE_NAME + name + ".ser");
if(f.exists()){ if (f.exists()) {
return true; return true;
} }
return false; return false;
@ -34,4 +54,21 @@ public class Persistenz {
ois.close(); ois.close();
return spiel; return spiel;
} }
/*------------------------------------------*/
// Getter und Setter
/*------------------------------------------*/
/*------------------------------------------*/
// @Overrides
/*------------------------------------------*/
/*------------------------------------------*/
// öffentliche Methodes
/*------------------------------------------*/
/*------------------------------------------*/
// Hilfsmethoden (privat)
/*------------------------------------------*/
} }