diff options
author | Masfehico <clyhtsuriva@gmail.com> | 2020-12-07 14:24:55 +0100 |
---|---|---|
committer | Masfehico <clyhtsuriva@gmail.com> | 2020-12-07 14:24:55 +0100 |
commit | 134f911d3b108d6dce101036e72c02e17a05e9a8 (patch) | |
tree | c7df8cbcf664ee3f18c67dfeb72d8ecd59fc52bd | |
parent | c620b561aa64b342dc9f5416a3d68f124f53117b (diff) |
Updating song, audiobook and musical elements's sets and gets
-rw-r--r-- | AudioBook.java | 6 | ||||
-rw-r--r-- | MusicalElement.java | 17 | ||||
-rw-r--r-- | Song.java | 5 |
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;} @@ -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;} } |