From e64ffae239b19871704b4ac1e9cd58275ed58622 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sat, 26 Jun 2021 12:34:26 +0200 Subject: Changed the architecture to respect maven and generated an empty javadoc --- src/main/java/musichub/business/MusicHub.java | 329 ++++++++++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100644 src/main/java/musichub/business/MusicHub.java (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java new file mode 100644 index 0000000..38e2214 --- /dev/null +++ b/src/main/java/musichub/business/MusicHub.java @@ -0,0 +1,329 @@ +package musichub.business; + +import musichub.util.XMLHandler; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.util.*; + +class SortByDate implements Comparator { + public int compare(Album a1, Album a2) { + return a1.getDate().compareTo(a2.getDate()); + } +} + +class SortByGenre implements Comparator { + public int compare(Song s1, Song s2) { + return s1.getGenre().compareTo(s2.getGenre()); + } +} + +class SortByAuthor implements Comparator { + public int compare(AudioElement e1, AudioElement e2) { + return e1.getArtist().compareTo(e2.getArtist()); + } +} + +public class MusicHub { + public static final String DIR = System.getProperty("user.dir"); + public static final String ALBUMS_FILE_PATH = DIR + "/files/albums.xml"; + public static final String PLAYLISTS_FILE_PATH = DIR + "/files/playlists.xml"; + public static final String ELEMENTS_FILE_PATH = DIR + "/files/elements.xml"; + private final List albums; + private final List playlists; + private final List elements; + private final XMLHandler xmlHandler = new XMLHandler(); + + public MusicHub() { + albums = new LinkedList<>(); + playlists = new LinkedList<>(); + elements = new LinkedList<>(); + this.loadElements(); + this.loadAlbums(); + this.loadPlaylists(); + } + + public void addElement(AudioElement element) { + elements.add(element); + } + + public void addAlbum(Album album) { + albums.add(album); + } + + public void addPlaylist(PlayList playlist) { + playlists.add(playlist); + } + + public void deletePlayList(String playListTitle) throws NoPlayListFoundException { + + PlayList thePlayList = null; + boolean result = false; + for (PlayList pl : playlists) { + if (pl.getTitle().equalsIgnoreCase(playListTitle)) { + thePlayList = pl; + break; + } + } + + if (thePlayList != null) + result = playlists.remove(thePlayList); + if (!result) throw new NoPlayListFoundException("Playlist " + playListTitle + " not found!"); + } + + public Iterator albums() { + return albums.listIterator(); + } + + public Iterator playlists() { + return playlists.listIterator(); + } + + public Iterator elements() { + return elements.listIterator(); + } + + public String getAlbumsTitlesSortedByDate() { + StringBuilder titleList = new StringBuilder(); + albums.sort(new SortByDate()); + for (Album al : albums) + titleList.append(al.getTitle()).append("\n"); + return titleList.toString(); + } + + public String getAudiobooksTitlesSortedByAuthor() { + StringBuilder titleList = new StringBuilder(); + List audioBookList = new ArrayList<>(); + for (AudioElement ae : elements) + if (ae instanceof AudioBook) + audioBookList.add(ae); + audioBookList.sort(new SortByAuthor()); + for (AudioElement ab : audioBookList) + titleList.append(ab.getArtist()).append("\n"); + return titleList.toString(); + } + + public List getAlbumSongs(String albumTitle) throws NoAlbumFoundException { + Album theAlbum = null; + ArrayList songsInAlbum = new ArrayList<>(); + for (Album al : albums) { + if (al.getTitle().equalsIgnoreCase(albumTitle)) { + theAlbum = al; + break; + } + } + if (theAlbum == null) throw new NoAlbumFoundException("No album with this title in the MusicHub!"); + + List songIDs = theAlbum.getSongs(); + for (UUID id : songIDs) + for (AudioElement el : elements) { + if (el instanceof Song) { + if (el.getUUID().equals(id)) songsInAlbum.add(el); + } + } + return songsInAlbum; + + } + + public List getAlbumSongsSortedByGenre(String albumTitle) throws NoAlbumFoundException { + Album theAlbum = null; + ArrayList songsInAlbum = new ArrayList<>(); + for (Album al : albums) { + if (al.getTitle().equalsIgnoreCase(albumTitle)) { + theAlbum = al; + break; + } + } + if (theAlbum == null) throw new NoAlbumFoundException("No album with this title in the MusicHub!"); + + List songIDs = theAlbum.getSongs(); + for (UUID id : songIDs) + for (AudioElement el : elements) { + if (el instanceof Song) { + if (el.getUUID().equals(id)) songsInAlbum.add((Song) el); + } + } + songsInAlbum.sort(new SortByGenre()); + return songsInAlbum; + + } + + public void addElementToAlbum(String elementTitle, String albumTitle) throws NoAlbumFoundException, NoElementFoundException { + Album theAlbum = null; + int i; + boolean found = false; + for (i = 0; i < albums.size(); i++) { + if (albums.get(i).getTitle().equalsIgnoreCase(albumTitle)) { + theAlbum = albums.get(i); + found = true; + break; + } + } + + if (found) { + AudioElement theElement = null; + for (AudioElement ae : elements) { + if (ae.getTitle().equalsIgnoreCase(elementTitle)) { + theElement = ae; + break; + } + } + if (theElement != null) { + theAlbum.addSong(theElement.getUUID()); + //replace the album in the list + albums.set(i, theAlbum); + } else throw new NoElementFoundException("Element " + elementTitle + " not found!"); + } else throw new NoAlbumFoundException("Album " + albumTitle + " not found!"); + + } + + public void addElementToPlayList(String elementTitle, String playListTitle) throws NoPlayListFoundException, NoElementFoundException { + PlayList thePlaylist = null; + int i; + boolean found = false; + + for (i = 0; i < playlists.size(); i++) { + if (playlists.get(i).getTitle().equalsIgnoreCase(playListTitle)) { + thePlaylist = playlists.get(i); + found = true; + break; + } + } + + if (found) { + AudioElement theElement = null; + for (AudioElement ae : elements) { + if (ae.getTitle().equalsIgnoreCase(elementTitle)) { + theElement = ae; + break; + } + } + if (theElement != null) { + thePlaylist.addElement(theElement.getUUID()); + //replace the album in the list + playlists.set(i, thePlaylist); + } else throw new NoElementFoundException("Element " + elementTitle + " not found!"); + + } else throw new NoPlayListFoundException("Playlist " + playListTitle + " not found!"); + + } + + private void loadAlbums() { + NodeList albumNodes = xmlHandler.parseXMLFile(ALBUMS_FILE_PATH); + if (albumNodes == null) return; + + for (int i = 0; i < albumNodes.getLength(); i++) { + if (albumNodes.item(i).getNodeType() == Node.ELEMENT_NODE) { + Element albumElement = (Element) albumNodes.item(i); + if (albumElement.getNodeName().equals("album")) { + try { + this.addAlbum(new Album(albumElement)); + } catch (Exception ex) { + System.out.println("Something is wrong with the XML album element"); + } + } + } + } + } + + private void loadPlaylists() { + NodeList playlistNodes = xmlHandler.parseXMLFile(PLAYLISTS_FILE_PATH); + if (playlistNodes == null) return; + + for (int i = 0; i < playlistNodes.getLength(); i++) { + if (playlistNodes.item(i).getNodeType() == Node.ELEMENT_NODE) { + Element playlistElement = (Element) playlistNodes.item(i); + if (playlistElement.getNodeName().equals("playlist")) { + try { + this.addPlaylist(new PlayList(playlistElement)); + } catch (Exception ex) { + System.out.println("Something is wrong with the XML playlist element"); + } + } + } + } + } + + private void loadElements() { + NodeList audioelementsNodes = xmlHandler.parseXMLFile(ELEMENTS_FILE_PATH); + if (audioelementsNodes == null) return; + + for (int i = 0; i < audioelementsNodes.getLength(); i++) { + if (audioelementsNodes.item(i).getNodeType() == Node.ELEMENT_NODE) { + Element audioElement = (Element) audioelementsNodes.item(i); + if (audioElement.getNodeName().equals("song")) { + try { + AudioElement newSong = new Song(audioElement); + this.addElement(newSong); + } catch (Exception ex) { + System.out.println("Something is wrong with the XML song element"); + } + } + if (audioElement.getNodeName().equals("audiobook")) { + try { + AudioElement newAudioBook = new AudioBook(audioElement); + this.addElement(newAudioBook); + } catch (Exception ex) { + System.out.println("Something is wrong with the XML audiobook element"); + } + } + } + } + } + + + public void saveAlbums() { + Document document = xmlHandler.createXMLDocument(); + if (document == null) return; + + // root element + Element root = document.createElement("albums"); + document.appendChild(root); + + //save all albums + for (Iterator albumsIter = this.albums(); albumsIter.hasNext(); ) { + Album currentAlbum = albumsIter.next(); + currentAlbum.createXMLElement(document, root); + } + xmlHandler.createXMLFile(document, ALBUMS_FILE_PATH); + } + + public void savePlayLists() { + Document document = xmlHandler.createXMLDocument(); + if (document == null) return; + + // root element + Element root = document.createElement("playlists"); + document.appendChild(root); + + //save all playlists + for (Iterator playlistsIter = this.playlists(); playlistsIter.hasNext(); ) { + PlayList currentPlayList = playlistsIter.next(); + currentPlayList.createXMLElement(document, root); + } + xmlHandler.createXMLFile(document, PLAYLISTS_FILE_PATH); + } + + public void saveElements() { + Document document = xmlHandler.createXMLDocument(); + if (document == null) return; + + // root element + Element root = document.createElement("elements"); + document.appendChild(root); + + //save all AudioElements + for (AudioElement currentElement : elements) { + + if (currentElement instanceof Song) { + currentElement.createXMLElement(document, root); + } + if (currentElement instanceof AudioBook) { + currentElement.createXMLElement(document, root); + } + } + xmlHandler.createXMLFile(document, ELEMENTS_FILE_PATH); + } +} \ No newline at end of file -- cgit v1.2.3 From 8e13dba6e1c39dd841d60fddc3c4060f9b4a4b85 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Sat, 26 Jun 2021 13:32:26 +0200 Subject: Removed reduced pom and added the content of STZ-0001 with a switch modif. --- Song/Side_To_Side.wav | Bin 0 -> 43422962 bytes dependency-reduced-pom.xml | 67 --------------------- files/albums.xml | 2 + files/elements.xml | 6 +- pom.xml | 1 + src/main/java/musichub/business/AudioElement.java | 34 +++++++++++ src/main/java/musichub/business/MusicHub.java | 12 ++++ src/main/java/musichub/business/Song.java | 2 + src/main/java/musichub/main/Main.java | 12 +++- .../classes/musichub/business/AudioElement.class | Bin 3752 -> 5392 bytes target/classes/musichub/business/MusicHub.class | Bin 11031 -> 11543 bytes .../classes/musichub/business/SortByAuthor.class | Bin 901 -> 901 bytes target/classes/musichub/business/SortByDate.class | Bin 854 -> 854 bytes target/classes/musichub/business/SortByGenre.class | Bin 858 -> 858 bytes target/classes/musichub/main/Main.class | Bin 9390 -> 9840 bytes target/maven-archiver/pom.properties | 2 +- target/maven-javadoc-plugin-stale-data.txt | 38 ++++++------ target/original-spoteezer-0.1.0.jar | Bin 29836 -> 31130 bytes target/site/apidocs/allclasses-index.html | 2 +- target/site/apidocs/allpackages-index.html | 2 +- target/site/apidocs/help-doc.html | 2 +- target/site/apidocs/index-all.html | 6 +- target/site/apidocs/index.html | 2 +- target/site/apidocs/member-search-index.js | 2 +- target/site/apidocs/musichub/business/Album.html | 2 +- .../site/apidocs/musichub/business/AudioBook.html | 4 +- .../apidocs/musichub/business/AudioElement.html | 24 +++++++- .../site/apidocs/musichub/business/Category.html | 2 +- target/site/apidocs/musichub/business/Genre.html | 2 +- .../site/apidocs/musichub/business/Language.html | 2 +- .../site/apidocs/musichub/business/MusicHub.html | 36 ++++++++--- .../musichub/business/NoAlbumFoundException.html | 2 +- .../musichub/business/NoElementFoundException.html | 2 +- .../business/NoPlayListFoundException.html | 2 +- .../site/apidocs/musichub/business/PlayList.html | 2 +- target/site/apidocs/musichub/business/Song.html | 4 +- .../apidocs/musichub/business/class-use/Album.html | 2 +- .../musichub/business/class-use/AudioBook.html | 2 +- .../musichub/business/class-use/AudioElement.html | 12 +++- .../musichub/business/class-use/Category.html | 2 +- .../apidocs/musichub/business/class-use/Genre.html | 2 +- .../musichub/business/class-use/Language.html | 2 +- .../musichub/business/class-use/MusicHub.html | 2 +- .../business/class-use/NoAlbumFoundException.html | 6 +- .../class-use/NoElementFoundException.html | 2 +- .../class-use/NoPlayListFoundException.html | 2 +- .../musichub/business/class-use/PlayList.html | 2 +- .../apidocs/musichub/business/class-use/Song.html | 2 +- .../apidocs/musichub/business/package-summary.html | 2 +- .../apidocs/musichub/business/package-tree.html | 2 +- .../apidocs/musichub/business/package-use.html | 2 +- target/site/apidocs/musichub/main/Main.html | 13 +++- .../site/apidocs/musichub/main/class-use/Main.html | 2 +- .../apidocs/musichub/main/package-summary.html | 2 +- .../site/apidocs/musichub/main/package-tree.html | 2 +- target/site/apidocs/musichub/main/package-use.html | 2 +- target/site/apidocs/musichub/util/XMLHandler.html | 2 +- .../musichub/util/class-use/XMLHandler.html | 2 +- .../apidocs/musichub/util/package-summary.html | 2 +- .../site/apidocs/musichub/util/package-tree.html | 2 +- target/site/apidocs/musichub/util/package-use.html | 2 +- target/site/apidocs/overview-summary.html | 2 +- target/site/apidocs/overview-tree.html | 2 +- target/site/apidocs/serialized-form.html | 2 +- target/spoteezer-0.1.0.jar | Bin 365706 -> 367000 bytes 65 files changed, 208 insertions(+), 149 deletions(-) create mode 100644 Song/Side_To_Side.wav delete mode 100644 dependency-reduced-pom.xml (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/Song/Side_To_Side.wav b/Song/Side_To_Side.wav new file mode 100644 index 0000000..3c874db Binary files /dev/null and b/Song/Side_To_Side.wav differ diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml deleted file mode 100644 index de729db..0000000 --- a/dependency-reduced-pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - esiea.softwareengineering - spoteezer - 0.1.0 - - - - maven-shade-plugin - 3.2.4 - - - package - - shade - - - - - musichub.main.Main - - - - - - - - maven-surefire-plugin - 2.22.0 - - - org.jacoco - jacoco-maven-plugin - 0.8.7 - - - - prepare-agent - - - - report - test - - report - - - - - - maven-compiler-plugin - - 16 - 16 - - - - - - 16 - 16 - 16 - 16 - - diff --git a/files/albums.xml b/files/albums.xml index edfd610..edb2a94 100644 --- a/files/albums.xml +++ b/files/albums.xml @@ -12,6 +12,7 @@ b2ee0ca0-b5e2-4bc9-8fed-7932fb145f2f bbe99998-1be6-4a40-8bf0-6a7fce9087c9 66d277ca-cbc4-471c-a07e-082363375bcc + 44136020-dc80-4522-9b71-2b9aad5e3039 @@ -22,6 +23,7 @@ 1978-01-23 44136020-dc80-4522-9b71-2b9aad5e3039 + 66d277ca-cbc4-471c-a07e-082363375bcc \ No newline at end of file diff --git a/files/elements.xml b/files/elements.xml index 7fefc5f..553f228 100644 --- a/files/elements.xml +++ b/files/elements.xml @@ -9,11 +9,11 @@ pop - I Want to Hold your Hand - The Beatles + Side To Side + Ariana Grande 186 66d277ca-cbc4-471c-a07e-082363375bcc - i_want_to_hold_your_hand.mp3 + Song/Side_To_Side.wav rock diff --git a/pom.xml b/pom.xml index 821c1b6..7ebddc1 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,7 @@ shade + false diff --git a/src/main/java/musichub/business/AudioElement.java b/src/main/java/musichub/business/AudioElement.java index e0a686b..0a51c16 100644 --- a/src/main/java/musichub/business/AudioElement.java +++ b/src/main/java/musichub/business/AudioElement.java @@ -3,6 +3,10 @@ package musichub.business; import org.w3c.dom.Document; import org.w3c.dom.Element; +import javax.sound.sampled.*; +import java.io.File; +import java.io.IOException; +import java.util.Scanner; import java.util.UUID; public abstract class AudioElement { @@ -85,4 +89,34 @@ public abstract class AudioElement { } + public void manageAudioElement() throws UnsupportedAudioFileException, IOException, LineUnavailableException { + + Scanner scanner = new Scanner(System.in); + + File file = new File(this.content); + AudioInputStream audioStream = AudioSystem.getAudioInputStream(file); + Clip clip = AudioSystem.getClip(); + clip.open(audioStream); + + String action = ""; + + while (!action.equals("Q")) { + System.out.println("P = Play \b S = Stop \b R = Reset \b Q = Quit"); + System.out.println("Enter your choice"); + action = scanner.next(); + action = action.toUpperCase(); + + switch (action) { + case "S", "Q" -> clip.stop(); + case "P" -> clip.start(); + case "R" -> clip.setMicrosecondPosition(0); + default -> System.out.println("try again"); + } + System.out.println("You stopped the Audio element"); + } + + clip.close(); + + } + } \ No newline at end of file diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index 38e2214..f289f1a 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -6,6 +6,9 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.IOException; import java.util.*; class SortByDate implements Comparator { @@ -326,4 +329,13 @@ public class MusicHub { } xmlHandler.createXMLFile(document, ELEMENTS_FILE_PATH); } + + public void getAudioElement(List audios, String elementTitle) throws NoAlbumFoundException, UnsupportedAudioFileException, IOException, LineUnavailableException { + for (AudioElement el : audios) { + if (el.getTitle().equalsIgnoreCase(elementTitle)) { + el.manageAudioElement(); + } + } + + } } \ No newline at end of file diff --git a/src/main/java/musichub/business/Song.java b/src/main/java/musichub/business/Song.java index 3e9011b..5d044a9 100644 --- a/src/main/java/musichub/business/Song.java +++ b/src/main/java/musichub/business/Song.java @@ -53,4 +53,6 @@ public class Song extends AudioElement { parentElement.appendChild(song); } + + } \ No newline at end of file diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java index b72a95b..c820b5d 100644 --- a/src/main/java/musichub/main/Main.java +++ b/src/main/java/musichub/main/Main.java @@ -2,11 +2,15 @@ package musichub.main; import musichub.business.*; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.IOException; import java.util.Iterator; +import java.util.List; import java.util.Scanner; public class Main { - public static void main(String[] args) { + public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException { MusicHub theHub = new MusicHub(); @@ -41,7 +45,8 @@ public class Main { albumTitle = scan.nextLine(); try { - System.out.println(theHub.getAlbumSongsSortedByGenre(albumTitle)); + List songs = theHub.getAlbumSongsSortedByGenre(albumTitle); + System.out.println(songs); } catch (NoAlbumFoundException ex) { System.out.println("No album found with the requested title " + ex.getMessage()); } @@ -55,7 +60,10 @@ public class Main { albumTitle = scan.nextLine(); try { + List songs = theHub.getAlbumSongs(albumTitle); System.out.println(theHub.getAlbumSongs(albumTitle)); + String song = scan.nextLine(); + theHub.getAudioElement(songs, song); } catch (NoAlbumFoundException ex) { System.out.println("No album found with the requested title " + ex.getMessage()); } diff --git a/target/classes/musichub/business/AudioElement.class b/target/classes/musichub/business/AudioElement.class index ab20d50..3579513 100644 Binary files a/target/classes/musichub/business/AudioElement.class and b/target/classes/musichub/business/AudioElement.class differ diff --git a/target/classes/musichub/business/MusicHub.class b/target/classes/musichub/business/MusicHub.class index e1a0961..8b8b280 100644 Binary files a/target/classes/musichub/business/MusicHub.class and b/target/classes/musichub/business/MusicHub.class differ diff --git a/target/classes/musichub/business/SortByAuthor.class b/target/classes/musichub/business/SortByAuthor.class index fb8ee7a..ac4474a 100644 Binary files a/target/classes/musichub/business/SortByAuthor.class and b/target/classes/musichub/business/SortByAuthor.class differ diff --git a/target/classes/musichub/business/SortByDate.class b/target/classes/musichub/business/SortByDate.class index c52e870..6892059 100644 Binary files a/target/classes/musichub/business/SortByDate.class and b/target/classes/musichub/business/SortByDate.class differ diff --git a/target/classes/musichub/business/SortByGenre.class b/target/classes/musichub/business/SortByGenre.class index 2016012..7cabb3e 100644 Binary files a/target/classes/musichub/business/SortByGenre.class and b/target/classes/musichub/business/SortByGenre.class differ diff --git a/target/classes/musichub/main/Main.class b/target/classes/musichub/main/Main.class index 06c19ac..1e19601 100644 Binary files a/target/classes/musichub/main/Main.class and b/target/classes/musichub/main/Main.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties index 93fc220..1b408a6 100644 --- a/target/maven-archiver/pom.properties +++ b/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Sat Jun 26 12:55:18 CEST 2021 +#Sat Jun 26 13:25:26 CEST 2021 groupId=esiea.softwareengineering artifactId=spoteezer version=0.1.0 diff --git a/target/maven-javadoc-plugin-stale-data.txt b/target/maven-javadoc-plugin-stale-data.txt index 106bfed..c701b12 100644 --- a/target/maven-javadoc-plugin-stale-data.txt +++ b/target/maven-javadoc-plugin-stale-data.txt @@ -43,22 +43,22 @@ C:\Users\SoftA\.m2\repository\org\opentest4j\opentest4j\1.0.0\opentest4j-1.0.0.j C:\Users\SoftA\.m2\repository\org\junit\platform\junit-platform-commons\1.0.2\junit-platform-commons-1.0.2.jar = 1624015816770 C:\Users\SoftA\.m2\repository\org\junit\jupiter\junit-jupiter-engine\5.0.2\junit-jupiter-engine-5.0.2.jar = 1624015816790 C:\Users\SoftA\.m2\repository\org\junit\platform\junit-platform-engine\1.0.2\junit-platform-engine-1.0.2.jar = 1624015816783 -C:\Users\SoftA\Documents\spoteezer\src\main\java = 1624704746958 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\allclasses-index.html = 1624704928892 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\allpackages-index.html = 1624704928894 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\element-list = 1624704928806 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\help-doc.html = 1624704928918 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\index-all.html = 1624704928914 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\index.html = 1624704928876 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\jquery-ui.overrides.css = 1624704928938 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\member-search-index.js = 1624704928898 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\module-search-index.js = 1624704928895 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\overview-summary.html = 1624704928916 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\overview-tree.html = 1624704928873 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\package-search-index.js = 1624704928896 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\script.js = 1624704928921 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\search.js = 1624704928924 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\serialized-form.html = 1624704928827 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\stylesheet.css = 1624704928920 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\tag-search-index.js = 1624704928899 -C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\type-search-index.js = 1624704928897 \ No newline at end of file +C:\Users\SoftA\Documents\spoteezer\src\main\java = 1624705682872 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\allclasses-index.html = 1624706731862 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\allpackages-index.html = 1624706731864 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\element-list = 1624706731767 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\help-doc.html = 1624706731890 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\index-all.html = 1624706731885 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\index.html = 1624706731838 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\jquery-ui.overrides.css = 1624706731909 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\member-search-index.js = 1624706731868 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\module-search-index.js = 1624706731865 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\overview-summary.html = 1624706731887 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\overview-tree.html = 1624706731835 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\package-search-index.js = 1624706731866 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\script.js = 1624706731894 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\search.js = 1624706731895 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\serialized-form.html = 1624706731788 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\stylesheet.css = 1624706731892 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\tag-search-index.js = 1624706731869 +C:\Users\SoftA\Documents\spoteezer\target\site\apidocs\type-search-index.js = 1624706731867 \ No newline at end of file diff --git a/target/original-spoteezer-0.1.0.jar b/target/original-spoteezer-0.1.0.jar index 28e38bb..b2c45cf 100644 Binary files a/target/original-spoteezer-0.1.0.jar and b/target/original-spoteezer-0.1.0.jar differ diff --git a/target/site/apidocs/allclasses-index.html b/target/site/apidocs/allclasses-index.html index fb49088..83bf57c 100644 --- a/target/site/apidocs/allclasses-index.html +++ b/target/site/apidocs/allclasses-index.html @@ -2,7 +2,7 @@ - + All Classes (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/allpackages-index.html b/target/site/apidocs/allpackages-index.html index 9c043ad..a9e8eb8 100644 --- a/target/site/apidocs/allpackages-index.html +++ b/target/site/apidocs/allpackages-index.html @@ -2,7 +2,7 @@ - + All Packages (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/help-doc.html b/target/site/apidocs/help-doc.html index e124b74..a2e0731 100644 --- a/target/site/apidocs/help-doc.html +++ b/target/site/apidocs/help-doc.html @@ -2,7 +2,7 @@ - + API Help (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/index-all.html b/target/site/apidocs/index-all.html index f91c9b3..cd292d0 100644 --- a/target/site/apidocs/index-all.html +++ b/target/site/apidocs/index-all.html @@ -2,7 +2,7 @@ - + Index (spoteezer 0.1.0 API) @@ -164,6 +164,8 @@ loadScripts(document, 'script');
 
getAudiobooksTitlesSortedByAuthor() - Method in class musichub.business.MusicHub
 
+
getAudioElement(List<AudioElement>, String) - Method in class musichub.business.MusicHub
+
 
getCategory() - Method in class musichub.business.AudioBook
 
getCategory() - Method in enum class musichub.business.Category
@@ -223,6 +225,8 @@ loadScripts(document, 'script');
 
Main() - Constructor for class musichub.main.Main
 
+
manageAudioElement() - Method in class musichub.business.AudioElement
+
 
MusicHub - Class in musichub.business
 
MusicHub() - Constructor for class musichub.business.MusicHub
diff --git a/target/site/apidocs/index.html b/target/site/apidocs/index.html index 7c966a1..87cf0ec 100644 --- a/target/site/apidocs/index.html +++ b/target/site/apidocs/index.html @@ -2,7 +2,7 @@ - + Overview (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/member-search-index.js b/target/site/apidocs/member-search-index.js index d356ad0..784449a 100644 --- a/target/site/apidocs/member-search-index.js +++ b/target/site/apidocs/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"musichub.business","c":"MusicHub","l":"addAlbum(Album)","u":"addAlbum(musichub.business.Album)"},{"p":"musichub.business","c":"MusicHub","l":"addElement(AudioElement)","u":"addElement(musichub.business.AudioElement)"},{"p":"musichub.business","c":"PlayList","l":"addElement(UUID)","u":"addElement(java.util.UUID)"},{"p":"musichub.business","c":"MusicHub","l":"addElementToAlbum(String, String)","u":"addElementToAlbum(java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"addElementToPlayList(String, String)","u":"addElementToPlayList(java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"addPlaylist(PlayList)","u":"addPlaylist(musichub.business.PlayList)"},{"p":"musichub.business","c":"Album","l":"addSong(UUID)","u":"addSong(java.util.UUID)"},{"p":"musichub.business","c":"Album","l":"Album(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"Album","l":"Album(String, String, int, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String)"},{"p":"musichub.business","c":"Album","l":"Album(String, String, int, String, String, ArrayList)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.util.ArrayList)"},{"p":"musichub.business","c":"MusicHub","l":"ALBUMS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"albums()"},{"p":"musichub.business","c":"AudioElement","l":"artist"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(String, String, int, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(String, String, int, String, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(String, String, int, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(String, String, int, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Genre","l":"CLASSIC"},{"p":"musichub.business","c":"AudioElement","l":"content"},{"p":"musichub.util","c":"XMLHandler","l":"createXMLDocument()"},{"p":"musichub.business","c":"Album","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioBook","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioElement","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"PlayList","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"Song","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.util","c":"XMLHandler","l":"createXMLFile(Document, String)","u":"createXMLFile(org.w3c.dom.Document,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"deletePlayList(String)","u":"deletePlayList(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"DIR"},{"p":"musichub.business","c":"Category","l":"DOCUMENTARY"},{"p":"musichub.business","c":"MusicHub","l":"ELEMENTS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"elements()"},{"p":"musichub.business","c":"Language","l":"ENGLISH"},{"p":"musichub.business","c":"Language","l":"FRENCH"},{"p":"musichub.business","c":"Language","l":"GERMAN"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumSongs(String)","u":"getAlbumSongs(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumSongsSortedByGenre(String)","u":"getAlbumSongsSortedByGenre(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumsTitlesSortedByDate()"},{"p":"musichub.business","c":"AudioElement","l":"getArtist()"},{"p":"musichub.business","c":"MusicHub","l":"getAudiobooksTitlesSortedByAuthor()"},{"p":"musichub.business","c":"AudioBook","l":"getCategory()"},{"p":"musichub.business","c":"Category","l":"getCategory()"},{"p":"musichub.business","c":"Album","l":"getDate()"},{"p":"musichub.business","c":"PlayList","l":"getElements()"},{"p":"musichub.business","c":"Genre","l":"getGenre()"},{"p":"musichub.business","c":"Song","l":"getGenre()"},{"p":"musichub.business","c":"AudioBook","l":"getLanguage()"},{"p":"musichub.business","c":"Language","l":"getLanguage()"},{"p":"musichub.business","c":"Album","l":"getSongs()"},{"p":"musichub.business","c":"Album","l":"getSongsRandomly()"},{"p":"musichub.business","c":"Album","l":"getTitle()"},{"p":"musichub.business","c":"AudioElement","l":"getTitle()"},{"p":"musichub.business","c":"PlayList","l":"getTitle()"},{"p":"musichub.business","c":"AudioElement","l":"getUUID()"},{"p":"musichub.business","c":"Genre","l":"HIPHOP"},{"p":"musichub.business","c":"Language","l":"ITALIAN"},{"p":"musichub.business","c":"Genre","l":"JAZZ"},{"p":"musichub.business","c":"AudioElement","l":"lengthInSeconds"},{"p":"musichub.main","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"musichub.main","c":"Main","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"musichub.business","c":"MusicHub","l":"MusicHub()","u":"%3Cinit%3E()"},{"p":"musichub.business","c":"NoAlbumFoundException","l":"NoAlbumFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"NoElementFoundException","l":"NoElementFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"NoPlayListFoundException","l":"NoPlayListFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"Category","l":"NOVEL"},{"p":"musichub.util","c":"XMLHandler","l":"parseXMLFile(String)","u":"parseXMLFile(java.lang.String)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(String, String, ArrayList)","u":"%3Cinit%3E(java.lang.String,java.lang.String,java.util.ArrayList)"},{"p":"musichub.business","c":"MusicHub","l":"PLAYLISTS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"playlists()"},{"p":"musichub.business","c":"Genre","l":"POP"},{"p":"musichub.business","c":"Genre","l":"RAP"},{"p":"musichub.business","c":"Genre","l":"ROCK"},{"p":"musichub.business","c":"MusicHub","l":"saveAlbums()"},{"p":"musichub.business","c":"MusicHub","l":"saveElements()"},{"p":"musichub.business","c":"MusicHub","l":"savePlayLists()"},{"p":"musichub.business","c":"AudioBook","l":"setCategory(String)","u":"setCategory(java.lang.String)"},{"p":"musichub.business","c":"Song","l":"setGenre(String)","u":"setGenre(java.lang.String)"},{"p":"musichub.business","c":"AudioBook","l":"setLanguage(String)","u":"setLanguage(java.lang.String)"},{"p":"musichub.business","c":"Song","l":"Song(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"Song","l":"Song(String, String, int, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Song","l":"Song(String, String, int, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Language","l":"SPANISH"},{"p":"musichub.business","c":"Category","l":"SPEECH"},{"p":"musichub.business","c":"Category","l":"THEATER"},{"p":"musichub.business","c":"AudioElement","l":"title"},{"p":"musichub.business","c":"AudioBook","l":"toString()"},{"p":"musichub.business","c":"AudioElement","l":"toString()"},{"p":"musichub.business","c":"Song","l":"toString()"},{"p":"musichub.business","c":"AudioElement","l":"uuid"},{"p":"musichub.business","c":"Category","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Genre","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Language","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Category","l":"values()"},{"p":"musichub.business","c":"Genre","l":"values()"},{"p":"musichub.business","c":"Language","l":"values()"},{"p":"musichub.util","c":"XMLHandler","l":"XMLHandler()","u":"%3Cinit%3E()"},{"p":"musichub.business","c":"Category","l":"YOUTH"}];updateSearchResults(); \ No newline at end of file +memberSearchIndex = [{"p":"musichub.business","c":"MusicHub","l":"addAlbum(Album)","u":"addAlbum(musichub.business.Album)"},{"p":"musichub.business","c":"MusicHub","l":"addElement(AudioElement)","u":"addElement(musichub.business.AudioElement)"},{"p":"musichub.business","c":"PlayList","l":"addElement(UUID)","u":"addElement(java.util.UUID)"},{"p":"musichub.business","c":"MusicHub","l":"addElementToAlbum(String, String)","u":"addElementToAlbum(java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"addElementToPlayList(String, String)","u":"addElementToPlayList(java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"addPlaylist(PlayList)","u":"addPlaylist(musichub.business.PlayList)"},{"p":"musichub.business","c":"Album","l":"addSong(UUID)","u":"addSong(java.util.UUID)"},{"p":"musichub.business","c":"Album","l":"Album(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"Album","l":"Album(String, String, int, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String)"},{"p":"musichub.business","c":"Album","l":"Album(String, String, int, String, String, ArrayList)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.util.ArrayList)"},{"p":"musichub.business","c":"MusicHub","l":"ALBUMS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"albums()"},{"p":"musichub.business","c":"AudioElement","l":"artist"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(String, String, int, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"AudioBook","l":"AudioBook(String, String, int, String, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(String, String, int, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String)"},{"p":"musichub.business","c":"AudioElement","l":"AudioElement(String, String, int, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Genre","l":"CLASSIC"},{"p":"musichub.business","c":"AudioElement","l":"content"},{"p":"musichub.util","c":"XMLHandler","l":"createXMLDocument()"},{"p":"musichub.business","c":"Album","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioBook","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"AudioElement","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"PlayList","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.business","c":"Song","l":"createXMLElement(Document, Element)","u":"createXMLElement(org.w3c.dom.Document,org.w3c.dom.Element)"},{"p":"musichub.util","c":"XMLHandler","l":"createXMLFile(Document, String)","u":"createXMLFile(org.w3c.dom.Document,java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"deletePlayList(String)","u":"deletePlayList(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"DIR"},{"p":"musichub.business","c":"Category","l":"DOCUMENTARY"},{"p":"musichub.business","c":"MusicHub","l":"ELEMENTS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"elements()"},{"p":"musichub.business","c":"Language","l":"ENGLISH"},{"p":"musichub.business","c":"Language","l":"FRENCH"},{"p":"musichub.business","c":"Language","l":"GERMAN"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumSongs(String)","u":"getAlbumSongs(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumSongsSortedByGenre(String)","u":"getAlbumSongsSortedByGenre(java.lang.String)"},{"p":"musichub.business","c":"MusicHub","l":"getAlbumsTitlesSortedByDate()"},{"p":"musichub.business","c":"AudioElement","l":"getArtist()"},{"p":"musichub.business","c":"MusicHub","l":"getAudiobooksTitlesSortedByAuthor()"},{"p":"musichub.business","c":"MusicHub","l":"getAudioElement(List, String)","u":"getAudioElement(java.util.List,java.lang.String)"},{"p":"musichub.business","c":"AudioBook","l":"getCategory()"},{"p":"musichub.business","c":"Category","l":"getCategory()"},{"p":"musichub.business","c":"Album","l":"getDate()"},{"p":"musichub.business","c":"PlayList","l":"getElements()"},{"p":"musichub.business","c":"Genre","l":"getGenre()"},{"p":"musichub.business","c":"Song","l":"getGenre()"},{"p":"musichub.business","c":"AudioBook","l":"getLanguage()"},{"p":"musichub.business","c":"Language","l":"getLanguage()"},{"p":"musichub.business","c":"Album","l":"getSongs()"},{"p":"musichub.business","c":"Album","l":"getSongsRandomly()"},{"p":"musichub.business","c":"Album","l":"getTitle()"},{"p":"musichub.business","c":"AudioElement","l":"getTitle()"},{"p":"musichub.business","c":"PlayList","l":"getTitle()"},{"p":"musichub.business","c":"AudioElement","l":"getUUID()"},{"p":"musichub.business","c":"Genre","l":"HIPHOP"},{"p":"musichub.business","c":"Language","l":"ITALIAN"},{"p":"musichub.business","c":"Genre","l":"JAZZ"},{"p":"musichub.business","c":"AudioElement","l":"lengthInSeconds"},{"p":"musichub.main","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"musichub.main","c":"Main","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"musichub.business","c":"AudioElement","l":"manageAudioElement()"},{"p":"musichub.business","c":"MusicHub","l":"MusicHub()","u":"%3Cinit%3E()"},{"p":"musichub.business","c":"NoAlbumFoundException","l":"NoAlbumFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"NoElementFoundException","l":"NoElementFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"NoPlayListFoundException","l":"NoPlayListFoundException(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"Category","l":"NOVEL"},{"p":"musichub.util","c":"XMLHandler","l":"parseXMLFile(String)","u":"parseXMLFile(java.lang.String)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"musichub.business","c":"PlayList","l":"PlayList(String, String, ArrayList)","u":"%3Cinit%3E(java.lang.String,java.lang.String,java.util.ArrayList)"},{"p":"musichub.business","c":"MusicHub","l":"PLAYLISTS_FILE_PATH"},{"p":"musichub.business","c":"MusicHub","l":"playlists()"},{"p":"musichub.business","c":"Genre","l":"POP"},{"p":"musichub.business","c":"Genre","l":"RAP"},{"p":"musichub.business","c":"Genre","l":"ROCK"},{"p":"musichub.business","c":"MusicHub","l":"saveAlbums()"},{"p":"musichub.business","c":"MusicHub","l":"saveElements()"},{"p":"musichub.business","c":"MusicHub","l":"savePlayLists()"},{"p":"musichub.business","c":"AudioBook","l":"setCategory(String)","u":"setCategory(java.lang.String)"},{"p":"musichub.business","c":"Song","l":"setGenre(String)","u":"setGenre(java.lang.String)"},{"p":"musichub.business","c":"AudioBook","l":"setLanguage(String)","u":"setLanguage(java.lang.String)"},{"p":"musichub.business","c":"Song","l":"Song(Element)","u":"%3Cinit%3E(org.w3c.dom.Element)"},{"p":"musichub.business","c":"Song","l":"Song(String, String, int, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Song","l":"Song(String, String, int, String, String, String)","u":"%3Cinit%3E(java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String)"},{"p":"musichub.business","c":"Language","l":"SPANISH"},{"p":"musichub.business","c":"Category","l":"SPEECH"},{"p":"musichub.business","c":"Category","l":"THEATER"},{"p":"musichub.business","c":"AudioElement","l":"title"},{"p":"musichub.business","c":"AudioBook","l":"toString()"},{"p":"musichub.business","c":"AudioElement","l":"toString()"},{"p":"musichub.business","c":"Song","l":"toString()"},{"p":"musichub.business","c":"AudioElement","l":"uuid"},{"p":"musichub.business","c":"Category","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Genre","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Language","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"musichub.business","c":"Category","l":"values()"},{"p":"musichub.business","c":"Genre","l":"values()"},{"p":"musichub.business","c":"Language","l":"values()"},{"p":"musichub.util","c":"XMLHandler","l":"XMLHandler()","u":"%3Cinit%3E()"},{"p":"musichub.business","c":"Category","l":"YOUTH"}];updateSearchResults(); \ No newline at end of file diff --git a/target/site/apidocs/musichub/business/Album.html b/target/site/apidocs/musichub/business/Album.html index 3e67075..8d24dd6 100644 --- a/target/site/apidocs/musichub/business/Album.html +++ b/target/site/apidocs/musichub/business/Album.html @@ -2,7 +2,7 @@ - + Album (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/AudioBook.html b/target/site/apidocs/musichub/business/AudioBook.html index 48361da..0d8d9b5 100644 --- a/target/site/apidocs/musichub/business/AudioBook.html +++ b/target/site/apidocs/musichub/business/AudioBook.html @@ -2,7 +2,7 @@ - + AudioBook (spoteezer 0.1.0 API) @@ -159,7 +159,7 @@ loadScripts(document, 'script');

Methods inherited from class musichub.business.AudioElement

-getArtist, getTitle, getUUID
+getArtist, getTitle, getUUID, manageAudioElement

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
diff --git a/target/site/apidocs/musichub/business/AudioElement.html b/target/site/apidocs/musichub/business/AudioElement.html index 89abaab..493874c 100644 --- a/target/site/apidocs/musichub/business/AudioElement.html +++ b/target/site/apidocs/musichub/business/AudioElement.html @@ -2,7 +2,7 @@ - + AudioElement (spoteezer 0.1.0 API) @@ -164,9 +164,12 @@ loadScripts(document, 'script');
 
- - +
void
+
 
+ + +
 
@@ -290,6 +293,21 @@ loadScripts(document, 'script'); Element parentElement) +
  • +
    +

    manageAudioElement

    +
    public void manageAudioElement() + throws UnsupportedAudioFileException, +IOException, +LineUnavailableException
    +
    +
    Throws:
    +
    UnsupportedAudioFileException
    +
    IOException
    +
    LineUnavailableException
    +
    +
    +
  • diff --git a/target/site/apidocs/musichub/business/Category.html b/target/site/apidocs/musichub/business/Category.html index 839a958..7748822 100644 --- a/target/site/apidocs/musichub/business/Category.html +++ b/target/site/apidocs/musichub/business/Category.html @@ -2,7 +2,7 @@ - + Category (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/Genre.html b/target/site/apidocs/musichub/business/Genre.html index 0b854bf..f943c15 100644 --- a/target/site/apidocs/musichub/business/Genre.html +++ b/target/site/apidocs/musichub/business/Genre.html @@ -2,7 +2,7 @@ - + Genre (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/Language.html b/target/site/apidocs/musichub/business/Language.html index 96488c5..3690e27 100644 --- a/target/site/apidocs/musichub/business/Language.html +++ b/target/site/apidocs/musichub/business/Language.html @@ -2,7 +2,7 @@ - + Language (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/MusicHub.html b/target/site/apidocs/musichub/business/MusicHub.html index 9c5266c..9ef7adf 100644 --- a/target/site/apidocs/musichub/business/MusicHub.html +++ b/target/site/apidocs/musichub/business/MusicHub.html @@ -2,7 +2,7 @@ - + MusicHub (spoteezer 0.1.0 API) @@ -171,18 +171,22 @@ loadScripts(document, 'script');
     
    - - +
    void
    +
    getAudioElement​(List<AudioElement> audios, + String elementTitle)
     
    -
    void
    - + +
     
    void
    - +
     
    void
    - +
     
    +
    void
    + +
     
    @@ -373,6 +377,24 @@ loadScripts(document, 'script');
    public void saveElements()
    +
  • +
    +

    getAudioElement

    +
    public void getAudioElement(List<AudioElement> audios, + String elementTitle) + throws NoAlbumFoundException, +UnsupportedAudioFileException, +IOException, +LineUnavailableException
    +
    +
    Throws:
    +
    NoAlbumFoundException
    +
    UnsupportedAudioFileException
    +
    IOException
    +
    LineUnavailableException
    +
    +
    +
  • diff --git a/target/site/apidocs/musichub/business/NoAlbumFoundException.html b/target/site/apidocs/musichub/business/NoAlbumFoundException.html index 5a480c3..0809462 100644 --- a/target/site/apidocs/musichub/business/NoAlbumFoundException.html +++ b/target/site/apidocs/musichub/business/NoAlbumFoundException.html @@ -2,7 +2,7 @@ - + NoAlbumFoundException (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/NoElementFoundException.html b/target/site/apidocs/musichub/business/NoElementFoundException.html index 704f5ce..81e9dce 100644 --- a/target/site/apidocs/musichub/business/NoElementFoundException.html +++ b/target/site/apidocs/musichub/business/NoElementFoundException.html @@ -2,7 +2,7 @@ - + NoElementFoundException (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/NoPlayListFoundException.html b/target/site/apidocs/musichub/business/NoPlayListFoundException.html index 9d832fc..6a2c7a3 100644 --- a/target/site/apidocs/musichub/business/NoPlayListFoundException.html +++ b/target/site/apidocs/musichub/business/NoPlayListFoundException.html @@ -2,7 +2,7 @@ - + NoPlayListFoundException (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/PlayList.html b/target/site/apidocs/musichub/business/PlayList.html index 80f0b18..c294b58 100644 --- a/target/site/apidocs/musichub/business/PlayList.html +++ b/target/site/apidocs/musichub/business/PlayList.html @@ -2,7 +2,7 @@ - + PlayList (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/Song.html b/target/site/apidocs/musichub/business/Song.html index 0a4f1fd..57e0fa5 100644 --- a/target/site/apidocs/musichub/business/Song.html +++ b/target/site/apidocs/musichub/business/Song.html @@ -2,7 +2,7 @@ - + Song (spoteezer 0.1.0 API) @@ -151,7 +151,7 @@ loadScripts(document, 'script');

    Methods inherited from class musichub.business.AudioElement

    -getArtist, getTitle, getUUID
    +getArtist, getTitle, getUUID, manageAudioElement

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    diff --git a/target/site/apidocs/musichub/business/class-use/Album.html b/target/site/apidocs/musichub/business/class-use/Album.html index c7a6a88..eeb9cfe 100644 --- a/target/site/apidocs/musichub/business/class-use/Album.html +++ b/target/site/apidocs/musichub/business/class-use/Album.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.Album (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/AudioBook.html b/target/site/apidocs/musichub/business/class-use/AudioBook.html index 83d738a..07abecb 100644 --- a/target/site/apidocs/musichub/business/class-use/AudioBook.html +++ b/target/site/apidocs/musichub/business/class-use/AudioBook.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.AudioBook (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/AudioElement.html b/target/site/apidocs/musichub/business/class-use/AudioElement.html index 1a553bf..a0c35cf 100644 --- a/target/site/apidocs/musichub/business/class-use/AudioElement.html +++ b/target/site/apidocs/musichub/business/class-use/AudioElement.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.AudioElement (spoteezer 0.1.0 API) @@ -99,6 +99,16 @@ loadScripts(document, 'script');
    MusicHub.addElement​(AudioElement element)
     
    +
    Method parameters in musichub.business with type arguments of type AudioElement
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    void
    +
    MusicHub.getAudioElement​(List<AudioElement> audios, + String elementTitle)
    +
     
    +
    diff --git a/target/site/apidocs/musichub/business/class-use/Category.html b/target/site/apidocs/musichub/business/class-use/Category.html index 62d35c3..f916411 100644 --- a/target/site/apidocs/musichub/business/class-use/Category.html +++ b/target/site/apidocs/musichub/business/class-use/Category.html @@ -2,7 +2,7 @@ - + Uses of Enum Class musichub.business.Category (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/Genre.html b/target/site/apidocs/musichub/business/class-use/Genre.html index e87b8fb..a952ca6 100644 --- a/target/site/apidocs/musichub/business/class-use/Genre.html +++ b/target/site/apidocs/musichub/business/class-use/Genre.html @@ -2,7 +2,7 @@ - + Uses of Enum Class musichub.business.Genre (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/Language.html b/target/site/apidocs/musichub/business/class-use/Language.html index cf13a0c..6205bc4 100644 --- a/target/site/apidocs/musichub/business/class-use/Language.html +++ b/target/site/apidocs/musichub/business/class-use/Language.html @@ -2,7 +2,7 @@ - + Uses of Enum Class musichub.business.Language (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/MusicHub.html b/target/site/apidocs/musichub/business/class-use/MusicHub.html index 7ae64d9..8f239ba 100644 --- a/target/site/apidocs/musichub/business/class-use/MusicHub.html +++ b/target/site/apidocs/musichub/business/class-use/MusicHub.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.MusicHub (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/NoAlbumFoundException.html b/target/site/apidocs/musichub/business/class-use/NoAlbumFoundException.html index 165de5a..d948beb 100644 --- a/target/site/apidocs/musichub/business/class-use/NoAlbumFoundException.html +++ b/target/site/apidocs/musichub/business/class-use/NoAlbumFoundException.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.NoAlbumFoundException (spoteezer 0.1.0 API) @@ -81,6 +81,10 @@ loadScripts(document, 'script');
    MusicHub.getAlbumSongsSortedByGenre​(String albumTitle)
     
    +
    void
    +
    MusicHub.getAudioElement​(List<AudioElement> audios, + String elementTitle)
    +
     
    diff --git a/target/site/apidocs/musichub/business/class-use/NoElementFoundException.html b/target/site/apidocs/musichub/business/class-use/NoElementFoundException.html index b26799b..ae74b4d 100644 --- a/target/site/apidocs/musichub/business/class-use/NoElementFoundException.html +++ b/target/site/apidocs/musichub/business/class-use/NoElementFoundException.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.NoElementFoundException (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/NoPlayListFoundException.html b/target/site/apidocs/musichub/business/class-use/NoPlayListFoundException.html index 0ff787f..aab3251 100644 --- a/target/site/apidocs/musichub/business/class-use/NoPlayListFoundException.html +++ b/target/site/apidocs/musichub/business/class-use/NoPlayListFoundException.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.NoPlayListFoundException (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/PlayList.html b/target/site/apidocs/musichub/business/class-use/PlayList.html index f230f7f..4fdd1e0 100644 --- a/target/site/apidocs/musichub/business/class-use/PlayList.html +++ b/target/site/apidocs/musichub/business/class-use/PlayList.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.PlayList (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/class-use/Song.html b/target/site/apidocs/musichub/business/class-use/Song.html index 9d1c95e..92d62d4 100644 --- a/target/site/apidocs/musichub/business/class-use/Song.html +++ b/target/site/apidocs/musichub/business/class-use/Song.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.business.Song (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/package-summary.html b/target/site/apidocs/musichub/business/package-summary.html index 0df1343..b5af4ec 100644 --- a/target/site/apidocs/musichub/business/package-summary.html +++ b/target/site/apidocs/musichub/business/package-summary.html @@ -2,7 +2,7 @@ - + musichub.business (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/package-tree.html b/target/site/apidocs/musichub/business/package-tree.html index 8104cc3..f640a6b 100644 --- a/target/site/apidocs/musichub/business/package-tree.html +++ b/target/site/apidocs/musichub/business/package-tree.html @@ -2,7 +2,7 @@ - + musichub.business Class Hierarchy (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/business/package-use.html b/target/site/apidocs/musichub/business/package-use.html index a1cf6fb..7ed1edb 100644 --- a/target/site/apidocs/musichub/business/package-use.html +++ b/target/site/apidocs/musichub/business/package-use.html @@ -2,7 +2,7 @@ - + Uses of Package musichub.business (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/main/Main.html b/target/site/apidocs/musichub/main/Main.html index f0ef281..f8bfd28 100644 --- a/target/site/apidocs/musichub/main/Main.html +++ b/target/site/apidocs/musichub/main/Main.html @@ -2,7 +2,7 @@ - + Main (spoteezer 0.1.0 API) @@ -146,7 +146,16 @@ loadScripts(document, 'script');
  • main

    -
    public static void main(String[] args)
    +
    public static void main(String[] args) + throws UnsupportedAudioFileException, +IOException, +LineUnavailableException
    +
    +
    Throws:
    +
    UnsupportedAudioFileException
    +
    IOException
    +
    LineUnavailableException
    +
  • diff --git a/target/site/apidocs/musichub/main/class-use/Main.html b/target/site/apidocs/musichub/main/class-use/Main.html index 0af879d..6d45c1a 100644 --- a/target/site/apidocs/musichub/main/class-use/Main.html +++ b/target/site/apidocs/musichub/main/class-use/Main.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.main.Main (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/main/package-summary.html b/target/site/apidocs/musichub/main/package-summary.html index 4be4c16..350f1ec 100644 --- a/target/site/apidocs/musichub/main/package-summary.html +++ b/target/site/apidocs/musichub/main/package-summary.html @@ -2,7 +2,7 @@ - + musichub.main (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/main/package-tree.html b/target/site/apidocs/musichub/main/package-tree.html index 96aab23..8322e63 100644 --- a/target/site/apidocs/musichub/main/package-tree.html +++ b/target/site/apidocs/musichub/main/package-tree.html @@ -2,7 +2,7 @@ - + musichub.main Class Hierarchy (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/main/package-use.html b/target/site/apidocs/musichub/main/package-use.html index e22beef..698c432 100644 --- a/target/site/apidocs/musichub/main/package-use.html +++ b/target/site/apidocs/musichub/main/package-use.html @@ -2,7 +2,7 @@ - + Uses of Package musichub.main (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/util/XMLHandler.html b/target/site/apidocs/musichub/util/XMLHandler.html index 4b8d7ba..942ecac 100644 --- a/target/site/apidocs/musichub/util/XMLHandler.html +++ b/target/site/apidocs/musichub/util/XMLHandler.html @@ -2,7 +2,7 @@ - + XMLHandler (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/util/class-use/XMLHandler.html b/target/site/apidocs/musichub/util/class-use/XMLHandler.html index 7435f8d..f3cd47c 100644 --- a/target/site/apidocs/musichub/util/class-use/XMLHandler.html +++ b/target/site/apidocs/musichub/util/class-use/XMLHandler.html @@ -2,7 +2,7 @@ - + Uses of Class musichub.util.XMLHandler (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/util/package-summary.html b/target/site/apidocs/musichub/util/package-summary.html index b38851e..12cbd12 100644 --- a/target/site/apidocs/musichub/util/package-summary.html +++ b/target/site/apidocs/musichub/util/package-summary.html @@ -2,7 +2,7 @@ - + musichub.util (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/util/package-tree.html b/target/site/apidocs/musichub/util/package-tree.html index c4625b5..b987ff3 100644 --- a/target/site/apidocs/musichub/util/package-tree.html +++ b/target/site/apidocs/musichub/util/package-tree.html @@ -2,7 +2,7 @@ - + musichub.util Class Hierarchy (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/musichub/util/package-use.html b/target/site/apidocs/musichub/util/package-use.html index 471f563..cf30494 100644 --- a/target/site/apidocs/musichub/util/package-use.html +++ b/target/site/apidocs/musichub/util/package-use.html @@ -2,7 +2,7 @@ - + Uses of Package musichub.util (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/overview-summary.html b/target/site/apidocs/overview-summary.html index f15374c..0415e8e 100644 --- a/target/site/apidocs/overview-summary.html +++ b/target/site/apidocs/overview-summary.html @@ -2,7 +2,7 @@ - + spoteezer 0.1.0 API diff --git a/target/site/apidocs/overview-tree.html b/target/site/apidocs/overview-tree.html index cecf679..b53ddc6 100644 --- a/target/site/apidocs/overview-tree.html +++ b/target/site/apidocs/overview-tree.html @@ -2,7 +2,7 @@ - + Class Hierarchy (spoteezer 0.1.0 API) diff --git a/target/site/apidocs/serialized-form.html b/target/site/apidocs/serialized-form.html index d1ab954..de7162a 100644 --- a/target/site/apidocs/serialized-form.html +++ b/target/site/apidocs/serialized-form.html @@ -2,7 +2,7 @@ - + Serialized Form (spoteezer 0.1.0 API) diff --git a/target/spoteezer-0.1.0.jar b/target/spoteezer-0.1.0.jar index 3f4d90b..9f65573 100644 Binary files a/target/spoteezer-0.1.0.jar and b/target/spoteezer-0.1.0.jar differ -- cgit v1.2.3 From 45bd8c1b3836e442968c4bfedda546984edce4fd Mon Sep 17 00:00:00 2001 From: said belhadj Date: Sun, 27 Jun 2021 02:27:13 +0200 Subject: Add search functionality --- src/main/java/musichub/business/MusicHub.java | 16 ++++++++++++++++ src/main/java/musichub/main/Main.java | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index f7cf137..add55e6 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -339,4 +339,20 @@ public class MusicHub { } } + + public void searchAudioElement() throws UnsupportedAudioFileException, NoAlbumFoundException, LineUnavailableException, IOException { + Scanner scanner = new Scanner(System.in); + String word = scanner.next().toLowerCase(Locale.ROOT); + List searchResult = new ArrayList<>(); + for(AudioElement el : elements){ + if(el.getTitle().toLowerCase(Locale.ROOT).contains(word) || el.getArtist().toLowerCase(Locale.ROOT).contains(word)){ + searchResult.add(el); + System.out.println(el); + } + } + if (searchResult.size()==1){ + this.getAudioElement(searchResult, searchResult.get(0).getTitle()); + } + } + } \ No newline at end of file diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java index e2e4731..480a2c2 100644 --- a/src/main/java/musichub/main/Main.java +++ b/src/main/java/musichub/main/Main.java @@ -12,7 +12,8 @@ import java.util.Scanner; import static musichub.business.PathValidation.isPathValid; public class Main { - public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException { + public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException, NoAlbumFoundException { + MusicHub theHub = new MusicHub(); @@ -240,6 +241,10 @@ public class Main { printAvailableCommands(); choice = scan.nextLine(); break; + case 'r': + //search a music + theHub.searchAudioElement(); + break; default: break; @@ -262,4 +267,5 @@ public class Main { System.out.println("s: save elements, albums, playlists"); System.out.println("q: quit program"); } + } \ No newline at end of file -- cgit v1.2.3 From 6c977eff192830096d4d5cde27d31bfd21d16b7e Mon Sep 17 00:00:00 2001 From: said belhadj Date: Sun, 27 Jun 2021 13:54:33 +0200 Subject: Update search functionality --- src/main/java/musichub/business/MusicHub.java | 5 +++++ src/main/java/musichub/main/Main.java | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index add55e6..bbac505 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -342,6 +342,7 @@ public class MusicHub { public void searchAudioElement() throws UnsupportedAudioFileException, NoAlbumFoundException, LineUnavailableException, IOException { Scanner scanner = new Scanner(System.in); + System.out.println("Entrez le titre ou l'artiste de la musique que vous souhaitez chercher dans la base de données"); String word = scanner.next().toLowerCase(Locale.ROOT); List searchResult = new ArrayList<>(); for(AudioElement el : elements){ @@ -350,6 +351,10 @@ public class MusicHub { System.out.println(el); } } + + if(searchResult.isEmpty()){ + System.err.println("Aucun résultat pour votre recherche"); + } if (searchResult.size()==1){ this.getAudioElement(searchResult, searchResult.get(0).getTitle()); } diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java index 480a2c2..19cbede 100644 --- a/src/main/java/musichub/main/Main.java +++ b/src/main/java/musichub/main/Main.java @@ -244,6 +244,8 @@ public class Main { case 'r': //search a music theHub.searchAudioElement(); + printAvailableCommands(); + choice = scan.nextLine(); break; default: @@ -258,6 +260,7 @@ public class Main { System.out.println("g: display songs of an album, ordered by genre"); System.out.println("d: display songs of an album"); System.out.println("u: display audiobooks ordered by author"); + System.out.println("r: search audio elements"); System.out.println("c: add a new song"); System.out.println("a: add a new album"); System.out.println("+: add a song to an album"); -- cgit v1.2.3 From ac2ff63e60bba8e841746a067f27441e491f4235 Mon Sep 17 00:00:00 2001 From: said belhadj Date: Sun, 27 Jun 2021 16:56:11 +0200 Subject: Catch exception related to search functionality --- src/main/java/musichub/business/MusicHub.java | 4 ++-- src/main/java/musichub/main/Main.java | 10 +++++++++- target/classes/musichub/business/MusicHub.class | Bin 11543 -> 12505 bytes target/classes/musichub/main/Main.class | Bin 10315 -> 10771 bytes 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index bbac505..660f0f8 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -340,7 +340,7 @@ public class MusicHub { } - public void searchAudioElement() throws UnsupportedAudioFileException, NoAlbumFoundException, LineUnavailableException, IOException { + public void searchAudioElement() throws UnsupportedAudioFileException, NoAlbumFoundException, LineUnavailableException, IOException, NoElementFoundException { Scanner scanner = new Scanner(System.in); System.out.println("Entrez le titre ou l'artiste de la musique que vous souhaitez chercher dans la base de données"); String word = scanner.next().toLowerCase(Locale.ROOT); @@ -353,7 +353,7 @@ public class MusicHub { } if(searchResult.isEmpty()){ - System.err.println("Aucun résultat pour votre recherche"); + throw new NoElementFoundException("Any result for your search"); } if (searchResult.size()==1){ this.getAudioElement(searchResult, searchResult.get(0).getTitle()); diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java index cd1fd5f..b0f98f4 100644 --- a/src/main/java/musichub/main/Main.java +++ b/src/main/java/musichub/main/Main.java @@ -246,7 +246,15 @@ public class Main { break; case 'r': //search a music - theHub.searchAudioElement(); + try { + theHub.searchAudioElement(); + } + catch (NoElementFoundException e){ + System.err.println(e.getMessage()); + } + catch (java.io.FileNotFoundException e){ + System.err.println(e.getMessage()+" Please create a file with the extension .wav inside the song folder at root of the app"); + } printAvailableCommands(); case 'o': //consult the app logs diff --git a/target/classes/musichub/business/MusicHub.class b/target/classes/musichub/business/MusicHub.class index 9554eeb..41af154 100644 Binary files a/target/classes/musichub/business/MusicHub.class and b/target/classes/musichub/business/MusicHub.class differ diff --git a/target/classes/musichub/main/Main.class b/target/classes/musichub/main/Main.class index 38501eb..802184b 100644 Binary files a/target/classes/musichub/main/Main.class and b/target/classes/musichub/main/Main.class differ -- cgit v1.2.3 From 2b592b4986b92c85150ecb9d08a521e6391cc160 Mon Sep 17 00:00:00 2001 From: manthole <67294267+manthole@users.noreply.github.com> Date: Sun, 27 Jun 2021 23:10:38 +0200 Subject: Add new feature - display playlist --- src/main/java/musichub/business/MusicHub.java | 28 ++++++++++++++++++++++++ src/main/java/musichub/main/Main.java | 18 +++++++++++++++ target/classes/musichub/business/MusicHub.class | Bin 12507 -> 13297 bytes target/classes/musichub/main/Main.class | Bin 10828 -> 11373 bytes target/classes/musichub/util/Policy.class | Bin 10981 -> 10860 bytes 5 files changed, 46 insertions(+) (limited to 'src/main/java/musichub/business/MusicHub.java') diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java index 660f0f8..f6805b6 100644 --- a/src/main/java/musichub/business/MusicHub.java +++ b/src/main/java/musichub/business/MusicHub.java @@ -359,5 +359,33 @@ public class MusicHub { this.getAudioElement(searchResult, searchResult.get(0).getTitle()); } } + public String getPlayListsTitles() { + StringBuilder titleList = new StringBuilder(); + for (PlayList pl : playlists) + titleList.append(pl.getTitle()).append("\n"); + return titleList.toString(); + } + + public List getPlayListSongs(String playListTitle) throws NoPlayListFoundException { + PlayList thePlayList = null; + ArrayList songsInPlayList = new ArrayList<>(); + for (PlayList pl : playlists) { + if (pl.getTitle().equalsIgnoreCase(playListTitle)) { + thePlayList = pl; + break; + } + } + if (thePlayList == null) throw new NoPlayListFoundException("No playlist with this title in the MusicHub!"); + + List songIDs = thePlayList.getElements(); + for (UUID id : songIDs) + for (AudioElement el : elements) { + if (el instanceof Song) { + if (el.getUUID().equals(id)) songsInPlayList.add(el); + } + } + return songsInPlayList; + + } } \ No newline at end of file diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java index bbcae79..2394ce6 100644 --- a/src/main/java/musichub/main/Main.java +++ b/src/main/java/musichub/main/Main.java @@ -264,6 +264,23 @@ public class Main { System.out.println("Type h for available commands"); choice = scan.nextLine(); break; + case 'm': + //songs of a playlist + System.out.println("Songs of a playlist will be displayed; enter the playlist name, available playlists are:"); + System.out.println(theHub.getPlayListsTitles()); + + playListTitle = scan.nextLine(); + try { + List songs = theHub.getPlayListSongs(playListTitle); + System.out.println(theHub.getPlayListSongs(playListTitle)); + String song = scan.nextLine(); + theHub.getAudioElement(songs, song); + } catch (NoPlayListFoundException ex) { + System.out.println("No playlist found with the requested title " + ex.getMessage()); + } + printAvailableCommands(); + choice = scan.nextLine(); + break; default: break; @@ -283,6 +300,7 @@ public class Main { System.out.println("+: add a song to an album"); System.out.println("l: add a new audiobook"); System.out.println("p: create a new playlist from existing songs and audio books"); + System.out.println("m: display songs of a playlist"); System.out.println("-: delete an existing playlist"); System.out.println("s: save elements, albums, playlists"); System.out.println("o: consult the app logs"); diff --git a/target/classes/musichub/business/MusicHub.class b/target/classes/musichub/business/MusicHub.class index 8614d25..42d7480 100644 Binary files a/target/classes/musichub/business/MusicHub.class and b/target/classes/musichub/business/MusicHub.class differ diff --git a/target/classes/musichub/main/Main.class b/target/classes/musichub/main/Main.class index 6a37d2d..d1f8ea2 100644 Binary files a/target/classes/musichub/main/Main.class and b/target/classes/musichub/main/Main.class differ diff --git a/target/classes/musichub/util/Policy.class b/target/classes/musichub/util/Policy.class index bec4189..4bf6b23 100644 Binary files a/target/classes/musichub/util/Policy.class and b/target/classes/musichub/util/Policy.class differ -- cgit v1.2.3 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(-) (limited to 'src/main/java/musichub/business/MusicHub.java') 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