Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MusicDownloads{
- private List<DownloadInfo> downloadList;
- public MusicDownloads(){
- downloadList = new ArrayList<DownloadInfo>();
- }
- public DownloadInfo getDownloadInfo(String title){
- for (int i =0;i<=downloadList.length()-1;i++){
- if ((downloadList.get(i)).getTitle().equals(title))
- return downloadList.get(i);
- }
- return null;
- }
- public void updateDownloads(List<String> titles){
- for (int i = 0;i<=titles.length()-1;i++){
- if (!(titles.get(i).getDownloadInfo == null)){
- getDownloadInfo(titles.get(i)).incrementTimesDownloaded();
- continue;
- }
- dowloadList.add(new DownloadInfo(titles.get(i));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement