aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-06-28 18:17:41 +0200
committerClyhtsuriva <aimeric@adjutor.xyz>2021-06-28 18:17:41 +0200
commit31b3614486621564836abb2446a64976a70eec4b (patch)
treeeecb38c6321f724584fc1415e54aec00da9aab3f
parentc714806051ff100678d350262bb9f992bae06f5e (diff)
Javadocs comments for getPlayListTitles and getPlayListSongs.
-rw-r--r--src/main/java/musichub/business/MusicHub.java24
1 files 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<Album> {
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<AudioElement> getPlayListSongs(String playListTitle) throws NoPlayListFoundException {
PlayList thePlayList = null;
ArrayList<AudioElement> songsInPlayList = new ArrayList<>();