From 253f29e2a80d013578ed5a84020d819a5d513526 Mon Sep 17 00:00:00 2001 From: Philipp Kotte Date: Wed, 11 Oct 2023 17:04:28 +0200 Subject: [PATCH] Strukturanpassung in Persistenz.java --- Infrastructure/Persistenz.java | 43 +++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Infrastructure/Persistenz.java b/Infrastructure/Persistenz.java index 087cc3d..13b6959 100644 --- a/Infrastructure/Persistenz.java +++ b/Infrastructure/Persistenz.java @@ -12,11 +12,31 @@ import java.io.*; 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"); - if(f.exists()){ + if (f.exists()) { return true; } return false; @@ -34,4 +54,21 @@ public class Persistenz { ois.close(); return spiel; } + + /*------------------------------------------*/ + // Getter und Setter + /*------------------------------------------*/ + + /*------------------------------------------*/ + // @Overrides + /*------------------------------------------*/ + + /*------------------------------------------*/ + // öffentliche Methodes + /*------------------------------------------*/ + + /*------------------------------------------*/ + // Hilfsmethoden (privat) + /*------------------------------------------*/ + }