Hi I'm first year student writing a MP3 catalogue for my fist assignment. It has all the usual functions EG add track, delete track, swap tracks and sort track by name, title, artist etc. All communication is via the console window.
I have a main, MP3Track, MP3Interface and several comparator classes. Main calls static methods such as addTrack, searchCat, moveTrack and trackExists etc. MP3Track contains data members such as trackNo, trackName, artist, album & length. My collection is stored in an ArrayList.
MoveTrack swaps two track numbers if they exist.
I would like to add a favorites function.
Typical output below FYI
I was thinking that one possible option would be to add an extra data member in MP3Track (boolean inFav) flagging if this in or isn't. Then iterating through the collection and extracting favorites for manipulation etc.
To have another collection (what type of?) for favorites pointing to the original. One of the problems I can see with this is if a user adds a track number to favorites and then later swaps track numbers in the main collection my favorites will now contain a track I didn't choose to be there!! (I think). I want them to be able to add a track either by tack number or title. Am I right and if so how could I overcome this. Or maybe I've got this all wrong... maybe using a Set as they don't hold duplicates!
...all suggestions, improvements, pointers and advice much appreciated.
Great site BTW and I hope to be able to contribute one day.
Thanks in advance for any help.