public class jMusicHub
extends java.lang.Object
Constructor and Description |
---|
jMusicHub()
Constructor method, it is calling every methods and contains the command prompt.
|
Modifier and Type | Method and Description |
---|---|
static Album |
addAlbum(java.util.Scanner scan)
addAlbum is used to add albums thanks to the "a" option.
|
static AudioBook |
addAudioBook(java.util.Scanner scan)
addAudioBook is used to add songs thanks to the "l" option.
|
static Playlist |
addPlaylist(java.util.Scanner scan,
java.util.ArrayList<Song> songs,
java.util.ArrayList<AudioBook> audiobooks)
addPlaylist is used to add playlist thanks to the "p" option.
|
static Song |
addSong(java.util.Scanner scan)
addSong is used to add songs thanks to the "c" option.
|
static void |
addSongToAlbum(java.util.Scanner scan,
java.util.ArrayList<Album> albums,
java.util.ArrayList<Song> songs)
addSongToAlbum is called by the "+" command in order to add a song to an album.
|
static void |
contentOfAlbum(java.util.ArrayList<Album> albums)
contentOfAlbum is called by the "AC" command in order to display the content of a chosen album.
|
static void |
contentOfPlaylist(java.util.ArrayList<Playlist> playlists)
contentOfPlaylist is called by the "PC" command in order to display the content of a chosen playlist.
|
static java.util.ArrayList<Playlist> |
delPlaylist(java.util.ArrayList<Playlist> playlists)
delPlaylist is called by the "-" command in order to delete a playlist.
|
static java.util.ArrayList |
extract(java.lang.String filename)
Extract is used to print the content of the files and put them in the ArrayList used to add elements.
|
static void |
listAlbumsByDate()
listAlbumsByDate is called by the "AD" command in order to list the albums sorted by the date of release.
|
static void |
listAlbumsByGenre()
listAlbumsByGenre is called by the "AG" command in order to list the albums sorted by the genre of their songs.
|
static void |
listAudioBooksByAuthor()
listAudioBooksByAuthor is called by the "BA" command in order to list the audiobooks sorted by authors.
|
static void |
listById(java.lang.String filename)
list is called when using the "AB", "S", "A" and "P" commands in order to list the elements in respective files.
|
static void |
listPlaylistsByName()
listPlaylistsByName is called when using the "PN" command in order to list the playlists sorted by their name.
|
static void |
main(java.lang.String[] args)
The main method is used to launch the app.
|
static void |
save(java.lang.String filename,
java.util.ArrayList elements)
save is used by the command "s".
|
public static Song addSong(java.util.Scanner scan)
scan
- ScannerSong
public static AudioBook addAudioBook(java.util.Scanner scan)
scan
- ScannerAudioBook
public static Album addAlbum(java.util.Scanner scan)
scan
- ScannerAlbum
public static Playlist addPlaylist(java.util.Scanner scan, java.util.ArrayList<Song> songs, java.util.ArrayList<AudioBook> audiobooks)
scan
- Scannersongs
- ArrayListaudiobooks
- ArrayListPlaylist
public static void save(java.lang.String filename, java.util.ArrayList elements)
filename
- Stringelements
- ArrayListpublic static void listById(java.lang.String filename)
filename
- Stringpublic static void listPlaylistsByName()
Playlist.getName()
public static void listAlbumsByDate()
public static void listAlbumsByGenre()
Album.getGenre()
public static void listAudioBooksByAuthor()
public static java.util.ArrayList extract(java.lang.String filename)
filename
- Stringpublic static void addSongToAlbum(java.util.Scanner scan, java.util.ArrayList<Album> albums, java.util.ArrayList<Song> songs)
scan
- Scanneralbums
- ArrayListsongs
- ArrayListpublic static java.util.ArrayList<Playlist> delPlaylist(java.util.ArrayList<Playlist> playlists)
playlists
- ArrayListpublic static void contentOfPlaylist(java.util.ArrayList<Playlist> playlists)
playlists
- ArrayListpublic static void contentOfAlbum(java.util.ArrayList<Album> albums)
albums
- ArrayListpublic static void main(java.lang.String[] args)
args
- String[]