Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. public class MusicDownloads{
  2. private List<DownloadInfo> downloadList;
  3.  
  4. public MusicDownloads(){
  5. downloadList = new ArrayList<DownloadInfo>();
  6. }
  7.  
  8. public DownloadInfo getDownloadInfo(String title){
  9. for (int i =0;i<=downloadList.length()-1;i++){
  10. if ((downloadList.get(i)).getTitle().equals(title))
  11. return downloadList.get(i);
  12. }
  13. return null;
  14. }
  15.  
  16. public void updateDownloads(List<String> titles){
  17. for (int i = 0;i<=titles.length()-1;i++){
  18. if (!(titles.get(i).getDownloadInfo == null)){
  19. getDownloadInfo(titles.get(i)).incrementTimesDownloaded();
  20. continue;
  21. }
  22. dowloadList.add(new DownloadInfo(titles.get(i));
  23.  
  24. }
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement