diff --git a/README.md b/README.md index 59d4161..b68963c 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,12 @@ Please contact [MrThanasiz](https://github.com/MrThanasiz)/[Novvator](https://gi ## Versioning -For the versions available, see the [tags on this repository](https://github.com/your/project/tags). +For the versions available, check the [Releases tab on the repository](https://github.com/MrThanasiz/UoM-Erasmus-Helper/releases). ## Authors -* **Athanasios Stefanidis** - *InputDataFrame / Score / Tips / UniversitySelectFrame* - [MrThanasiz](https://github.com/MrThanasiz/) -* **Konstantinos Petridis** - *LogRegCheck / Secretariat / SecretariatFrame* - [Romputer](https://github.com/Romputer) +* **Athanasios Stefanidis** - *InputDataFrame / Score / Tips / UniversitySelectFrame / ValidationCheck* - [MrThanasiz](https://github.com/MrThanasiz/) +* **Konstantinos Petridis** - *LogRegCheck / Secretariat / SecretariatFrame / Student* - [Romputer](https://github.com/Romputer) * **Stamatis Sellas** - *Department / MainFrame / University* - [Novvator](https://github.com/Novvator) * **Stefanos Fokianos** - *CentralRegistry / CreateFile / HomeFrame / RegisterFrame* - [Stef-Fokianos](https://github.com/Stef-fokianos) diff --git a/src/CentralRegistry.java b/src/CentralRegistry.java index 8710293..acbff3e 100644 --- a/src/CentralRegistry.java +++ b/src/CentralRegistry.java @@ -8,7 +8,7 @@ public class CentralRegistry private static ArrayList students; - public static boolean initializedList = false; + private static boolean initializedList = false; @SuppressWarnings("unchecked") @@ -41,6 +41,28 @@ public static void desirializeUsers(){ c.printStackTrace(); } } + + public static void serializeUsers() { + + String filename = "student.ser"; + + // Serialization + try{ + //Saving of student in a file + FileOutputStream file = new FileOutputStream(filename); + ObjectOutputStream out = new ObjectOutputStream(file); + + // Method for serialization of Student s + out.writeObject(students); + + out.close(); + file.close(); + + // System.out.println("Serialization worked"); + }catch(IOException ex) { + System.out.println("IOException is caught"); + } + } public static Student registerNewUser() { @@ -53,34 +75,6 @@ public static Student registerNewUser() { return s.get(s.indexOf(stud)); } - - - - public static void serializeUsers() { - - String filename = "student.ser"; - - // Serialization - try{ - //Saving of student in a file - FileOutputStream file = new FileOutputStream(filename); - ObjectOutputStream out = new ObjectOutputStream(file); - - // Method for serialization of Student s - out.writeObject(students); - - out.close(); - file.close(); - - // System.out.println("Serialization worked"); - }catch(IOException ex) { - - System.out.println("IOException is caught"); - } - - - - } public static ArrayList getStudents(){ @@ -158,6 +152,10 @@ public static ArrayList getDepartments(){ return departmentsList; } + public static boolean initializedList() { + return initializedList; + } + public static void assignStudsToDeps() { for(Student student: students) { for(int i = 0; i < departmentsList.size(); i++) diff --git a/src/LogRegCheck.java b/src/LogRegCheck.java index a266f2e..fd94b80 100644 --- a/src/LogRegCheck.java +++ b/src/LogRegCheck.java @@ -3,7 +3,7 @@ public class LogRegCheck { public static Student checkUsername(String aUsername) { //We need a initializedList variable in Central Registry - if ( !CentralRegistry.initializedList ) + if ( !CentralRegistry.initializedList() ) return null; for(Student student: CentralRegistry.getStudents())