From 31b3614486621564836abb2446a64976a70eec4b Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Mon, 28 Jun 2021 18:17:41 +0200 Subject: Javadocs comments for getPlayListTitles and getPlayListSongs. --- src/main/java/musichub/business/MusicHub.java | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index f6805b6..8db2f11 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -6,11 +6,10 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import java.io.IOException; -import java.util.*; - import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.IOException; +import java.util.*; class SortByDate implements Comparator { public int compare(Album a1, Album a2) { @@ -352,13 +351,20 @@ public class MusicHub { } } - if(searchResult.isEmpty()){ + if (searchResult.isEmpty()) { throw new NoElementFoundException("Any result for your search"); } - if (searchResult.size()==1){ + if (searchResult.size() == 1) { this.getAudioElement(searchResult, searchResult.get(0).getTitle()); } } + + /** + * Method getting a list of playlists + * + * @return a list of playlist titles + * @author Anthony BOULANT + */ public String getPlayListsTitles() { StringBuilder titleList = new StringBuilder(); @@ -367,6 +373,14 @@ public class MusicHub { return titleList.toString(); } + /** + * Method checking the songs contained in a chosen playlist and returning them if found. + * + * @param playListTitle the title of a (chosen) playlist + * @return a list of songs from a playlist + * @throws NoPlayListFoundException if the chosen playlist doesn't exist + * @author Anthony BOULANT + */ public List getPlayListSongs(String playListTitle) throws NoPlayListFoundException { PlayList thePlayList = null; ArrayList songsInPlayList = new ArrayList<>(); -- cgit v1.2.3