Guest User

Untitled

a guest
Jan 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public int compareTo(Track other)
  2. {
  3. if (this.min > other.min ) return 1;
  4. if (this.min < other.min ) return -1;
  5. if (this.min == other.min )
  6. {
  7. if (this.sec < other.sec ) return -1;
  8. if (this.sec > other.sec ) return 1;
  9. else return 0;
  10. }
  11. return 0;
  12.  
  13. }
  14.  
  15. public String getArtist()
  16. {
  17. return artist;
  18. }
  19.  
  20. public String getSongName()
  21. {
  22. return songName;
  23. }
  24.  
  25. //public int compareTo(Track other)
  26. //{
  27. // if (this.getArtist < other.getArtist) return 1;
  28. //if (this.getArtist > other.getArtist) return -1;
  29. // return this.getSongName().compareTo(other.getSongName());
  30. //}
  31. }
Add Comment
Please, Sign In to add comment