From 7c23f453d166d396451504e26fbb385afc0c4c13 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Mon, 28 Dec 2020 17:31:33 +0100 Subject: Finishing javadoc --- Playlist.java | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'Playlist.java') 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 songs = new ArrayList(); private ArrayList audiobooks = new ArrayList(); +/** + * Constructor method. + * + * @param name String + * @param songs ArrayList + * @param audiobooks ArrayList + * + * @see Song + * @see AudioBook + * + * @author Aimeric ADJUTOR + * */ public Playlist(String name, ArrayList songs, ArrayList 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(); } -- cgit v1.2.3