diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2020-12-28 17:31:33 +0100 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2020-12-28 17:31:33 +0100 |
commit | 7c23f453d166d396451504e26fbb385afc0c4c13 (patch) | |
tree | 01aee8bfcd409dbaa3e90889295869903a4ab5d5 /Playlist.java | |
parent | de39259ada4f75ac987f9bd8f0674ebede75a0de (diff) |
Finishing javadoc
Diffstat (limited to 'Playlist.java')
-rw-r--r-- | Playlist.java | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/Playlist.java b/Playlist.java index fc1ea94..94cfdd6 100644 --- a/Playlist.java +++ b/Playlist.java @@ -1,6 +1,27 @@ +/* + * Name : Playlist + * + * Description : The Playlist class is used to create playlists containing songs and audiobooks. + * + * Version : 1.0 + * + * Date : 28/12/2020 + * + * Copyright : Aimeric ADJUTOR + */ + import java.util.ArrayList; import java.io.Serializable; +/** + * The Playlist class is used to create playlists containing songs and audiobooks. + * + * @version 1.0 + * @see Song + * @see AudioBook + * @author Aimeric ADJUTOR + */ + public class Playlist implements Serializable { private static final long serialVersionUID = 6021717365357635741L; @@ -9,19 +30,59 @@ public class Playlist implements Serializable { private ArrayList<Song> songs = new ArrayList<Song>(); private ArrayList<AudioBook> audiobooks = new ArrayList<AudioBook>(); +/** + * Constructor method. + * + * @param name String + * @param songs ArrayList + * @param audiobooks ArrayList + * + * @see Song + * @see AudioBook + * + * @author Aimeric ADJUTOR + * */ public Playlist(String name, ArrayList<Song> songs, ArrayList<AudioBook> audiobooks) { this.name=name; this.songs=songs; this.audiobooks=audiobooks; } +/** + * This method is used to give the id of the playlist. + * + * @return id int + * + * @author Aimeric ADJUTOR + * */ public int getId(){return id;} - public String getName(){return name.toUpperCase();} //using toUpperCase method because the way I sort by name sort he upper case then the lower case, which is inconvenient. + +/** + * This method is used to give the name of the playlist in uppercase. + * Using toUpperCase method because the way I sort by name sorts the upper case then the lower case, which is inconvenient. + * + * @return name.toUpperCase String + * + * @author Aimeric ADJUTOR + * */ + public String getName(){return name.toUpperCase();} + +/** + * This method is used to print the each songs contained in the songs attribute of the playlist. + * + * @author Aimeric ADJUTOR + * */ public void getSongs(){ for ( Song s : songs ){ System.out.println(s); } } + +/** + * This method is used to print the each audiobooks contained in the audiobooks attribute of the playlist. + * + * @author Aimeric ADJUTOR + * */ public void getAudioBooks(){ for (AudioBook b : audiobooks ){ System.out.println(b); @@ -29,9 +90,31 @@ public class Playlist implements Serializable { } +/** + * Basic method to set the id of the playlist. + * + * @param id int + * + * @author Aimeric ADJUTOR + * */ public void setId(int id){this.id=id;} + +/** + * Basic method to set the name of the playlist. + * + * @param name String + * + * @author Aimeric ADJUTOR + * */ public void setName(String name){this.name=name;} +/** + * Basic method to "configure" what does a print of this object actually does. + * + * @return String, using the object's methods + * + * @author Aimeric ADJUTOR + * */ public String toString() { return "Id : "+getId()+"\nName : "+getName(); } |