aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/musichub/business/MusicHub.java
diff options
context:
space:
mode:
authorClyhtsuriva <61652557+clyhtsuriva@users.noreply.github.com>2021-06-28 17:28:15 +0000
committerGitHub <noreply@github.com>2021-06-28 17:28:15 +0000
commitcc2d051f398fe43d0ccf1b6332338c899785e870 (patch)
tree5cbf82db4f07fd2f411872ce9dec510a7a309537 /src/main/java/musichub/business/MusicHub.java
parenta6f25cbfb673cfcdf29c3913d3add3bd7b2de5cd (diff)
parent6fd288b45c85552db14f49c3ce38be9105459f26 (diff)
Merge pull request #21 from Said-Belhadj/javadoc/STZ-0019
Javadoc/STZ-0019
Diffstat (limited to 'src/main/java/musichub/business/MusicHub.java')
-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<>();