diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-30 20:58:15 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-30 22:23:08 +0200 |
commit | d93e0603f97eeb66a1d261a3c06603097fd5a04c (patch) | |
tree | 97c39751489b4ef3c746ceb3ef667eca597987a1 /src/com.example.portfolio2 | |
parent | d55182f3a8a1105706d1bd127b801a8d7d5ff9a1 (diff) |
add draft class Person and related dummy Database methods
Diffstat (limited to 'src/com.example.portfolio2')
-rw-r--r-- | src/com.example.portfolio2/com/example/portfolio2/Database.java | 20 | ||||
-rw-r--r-- | src/com.example.portfolio2/com/example/portfolio2/Person.java | 18 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/com.example.portfolio2/com/example/portfolio2/Database.java b/src/com.example.portfolio2/com/example/portfolio2/Database.java index 6abaa54..8b8f93a 100644 --- a/src/com.example.portfolio2/com/example/portfolio2/Database.java +++ b/src/com.example.portfolio2/com/example/portfolio2/Database.java @@ -21,11 +21,31 @@ class Database { // (declared explicitly only to silence javadoc) Database() { } + /// student object + // TODO: replace this dummy placeholder with database query + private Person student; + /// clear the participation database at program launch void initialize() { clearParticipation(); } + /// Add student + /// + /// @param name Name of student + // TODO: replace this dummy placeholder with database query + public final void addStudent(final String name) { + student = new Person(name); + } + + /// Get student name + /// + /// @return name of student + // TODO: replace this dummy placeholder with database query + public final String getStudentName() { + return student.name; + } + /// resolve activity index from name /// /// @param name activity name diff --git a/src/com.example.portfolio2/com/example/portfolio2/Person.java b/src/com.example.portfolio2/com/example/portfolio2/Person.java new file mode 100644 index 0000000..aaf4c59 --- /dev/null +++ b/src/com.example.portfolio2/com/example/portfolio2/Person.java @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk> +// SPDX-License-Identifier: GPL-3.0-or-later + +package com.example.portfolio2; + +/// Bachelorizer - Person model +public class Person { + + /// Person name + public String name; + + /// Constructor + /// + /// @param name Name of person + public Person(final String name) { + this.name = name; + } +} |