/**
 * The CD class represents a music CD object. Information 
 * about the CD is stored and can be retrieved.
 *
 *@author Michael Kölling and David J. Barnes
 *@updates and changes by Michael Rivers
 *@version April 12th 2006
 */
public class CD extends Item
{
    private String artist;
    private int tracks;

    /** 
     * Default Constructor
     */
    public CD()
    {
        artist = "unavailable";
        tracks = 0;
    }

    /**
     * Initialize the CD and pass parameters to the parent class
     */
    public CD(String theTitle, String theArtist, int tracks, 
              int time)
    {
        super(theTitle, time);
        artist = theArtist;
        this.tracks = tracks;
    }
    
    /**
     * This constructor method also passes the "got it" parameter
     */
    public CD(String theTitle, String theArtist, int tracks, 
              int time, boolean haveIt)
    {
        super(theTitle, time, haveIt);
        artist = theArtist;
        this.tracks = tracks;
    }

    /**
     * This one passes "got it" and comment to its parent class
     */
    public CD(String theTitle, String theArtist, int tracks, 
              int time, boolean haveIt, String comment)
    {
        super(theTitle, time, haveIt, comment);
        artist = theArtist;
        this.tracks = tracks;
    }
    
    /**
     * Accessor method for number of tracks
     */
    public int getTracks()
    {
        return tracks;
    }
    
    /**
     * Mutator method for number of tracks
     */
    public void setTracks(int tracks)
    {
        this.tracks = tracks;
    }
    
    /**
     * Accessor method for artist
     */
    public String getArtist()
    {
        return artist;
    }
    
    /**
     * Mutator method to set or change the artist
     */
    public void setArtist(String theArtist)
    {
        artist = theArtist;
    }
    
    /**
     * Call parent's print method and prints additional 
     * details about the CD
     */
    public void print()
    {
        System.out.print("CD: ");
        super.print();
        System.out.println("    artist: " + artist);
        System.out.println("    tracks: " + tracks);
    }
}



