/** * CS 251L - Intermediate Programming * University of New Mexico - Los Alamos * Data Structures Lab. * * Information about a song. * * @author */ public class Song implements Cloneable { private String title; private String artist; private String category; private int year; public Song(String title, String artist, String category, int year) { this.title = title; this.artist = artist; this.category = category; this.year = year; } public String getTitle() { return this.title; } public String getArtist() { return this.artist; } public String getCategory() { return this.category; } public int getYear() { return this.year; } public String toString() { return title + " by " + artist + " (" + year + ", " + category + ")"; } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { throw new RuntimeException("This class should implement Cloneable"); } } }