aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasfehico <clyhtsuriva@gmail.com>2020-12-07 14:24:55 +0100
committerMasfehico <clyhtsuriva@gmail.com>2020-12-07 14:24:55 +0100
commit134f911d3b108d6dce101036e72c02e17a05e9a8 (patch)
treec7df8cbcf664ee3f18c67dfeb72d8ecd59fc52bd
parentc620b561aa64b342dc9f5416a3d68f124f53117b (diff)
Updating song, audiobook and musical elements's sets and gets
-rw-r--r--AudioBook.java6
-rw-r--r--MusicalElement.java17
-rw-r--r--Song.java5
3 files changed, 23 insertions, 5 deletions
diff --git a/AudioBook.java b/AudioBook.java
index d53a899..c1722dd 100644
--- a/AudioBook.java
+++ b/AudioBook.java
@@ -8,5 +8,11 @@ public class AudioBook extends MusicalElement {
}
+ public String getAuthor(){return author;}
+ public String getLanguage(){return language;}
+ public String getCategory(){return category;}
+ public void setArtist(String author){this.author=author;}
+ public void setGenre(String language){this.language=language;}
+ public void setCategory(String category){this.category=language;}
}
diff --git a/MusicalElement.java b/MusicalElement.java
index b5f6446..1edd7eb 100644
--- a/MusicalElement.java
+++ b/MusicalElement.java
@@ -1,11 +1,16 @@
/** The MusicalElement contains the base of songs and audibooks.
* It is the abstract class they will take.
- * We use the classical get and set here.*/
+ * We use the classical get and set here.
+ * Get is used to return the said value.
+ * Set is used to modify the later.*/
class MusicalElement {
+
+//Our vars
private int id, duration;
private String title, content;
+
public MusicalElement(int id, String title, int duration, String content) {
this.id=id;
this.title=title;
@@ -13,15 +18,17 @@ class MusicalElement {
this.content=content;
}
+//the gets
public int getId(){return id;}
public String getTitle(){return title;}
public int getDuration(){return duration;}
public String getContent(){return content;}
- public void setId(){this.id=id;}
- public void setTitle(){this.title=title;}
- public void setDuration(){this.duration=duration;}
- public void setContent(){this.content=content;}
+//the sets
+ public void setId(int id){this.id=id;}
+ public void setTitle(String title){this.title=title;}
+ public void setDuration(int duration){this.duration=duration;}
+ public void setContent(String content){this.content=content;}
diff --git a/Song.java b/Song.java
index 640059e..81392ab 100644
--- a/Song.java
+++ b/Song.java
@@ -5,4 +5,9 @@ public class Song extends MusicalElement {
this.artist=artist;
this.genre=genre;
}
+
+ public String getArtist(){return artist;}
+ public String getGenre(){return genre;}
+ public void setArtist(String artist){this.artist=artist;}
+ public void setGenre(String genre){this.genre=genre;}
}