From af21afd482a358ff206872de3e5ce3d8ab249c05 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 1 May 2025 11:41:09 +0200 Subject: have methods in abstract class Storage throw exception (not abstract methods) --- .../dk/biks/bachelorizer/Storage.java | 55 +++++++++++++++++----- 1 file changed, 44 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Storage.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Storage.java index 95e5851..5eff376 100644 --- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Storage.java +++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Storage.java @@ -14,57 +14,90 @@ abstract class Storage { Storage() { } /// initialization as needed - abstract void initialize(); + void initialize() { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// add student /// /// @param name Name of student - public abstract void addStudent(String name); + void addStudent(String name) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// get student name /// /// @return name of student - public abstract String getStudentName(); + String getStudentName() { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// resolve activity index from name /// /// @param name activity name /// @return index of activity as integer - abstract int getActivityIndeks(String name); + int getActivityIndeks(String name) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// insert activity into participation /// /// @param activityIndex index of activity - abstract void addParticipation(int activityIndex); + void addParticipation(int activityIndex) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// list currently participating activities /// /// @param program programme name /// @return names of participating activities - abstract ArrayList getParticipation(String program); + ArrayList getParticipation(String program) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// purge participation choices - abstract void clearParticipation(); + void clearParticipation() { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// list activities within a program /// /// @param program programme name /// @return names of contained activities - abstract ArrayList selectProgram(String program); + ArrayList selectProgram(String program) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// sum of ECTS points under the given category /// /// @param program programme name /// @return ECTS points as String - abstract String getSumEcts(String program); + String getSumEcts(String program) { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// list of available subject modules /// /// @return names of all subject modules as list of strings - abstract List getAllSubjects(); + List getAllSubjects() { + throw new UnsupportedOperationException( + "Not implemented yet"); + } /// list of available activities /// /// @return names of all activities as list of strings - abstract ArrayList getAllActivities(); + ArrayList getAllActivities() { + throw new UnsupportedOperationException( + "Not implemented yet"); + } } -- cgit v1.2.3