 


/**
 * 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
 *@version 2002-05-02
 */
public class Item
{
	protected String title;
	protected int playingTime;
	protected boolean gotIt;
	protected String comment;
	
	/**
	 * Initialise the fields of the item.
	 */
	public Item(String theTitle, int time)
	{
	    title = theTitle;
	    playingTime = time;
	    gotIt = false;
	    comment = "No Comment";
	}
	
	/**
	 * Constructor with gotIt parameter.
	 */
	public Item(String theTitle, int time, boolean haveIt)
	{
	    title = theTitle;
	    playingTime = time;
	    gotIt = haveIt;
	    comment = "No Comment";
	}
	   
	/**
	 * Constructor with gotIt and comment parameter
	 */
	public Item(String theTitle, int time, boolean haveIt, String newComment)
	{
	    title = theTitle;
	    playingTime = time;
	    gotIt = haveIt;
	    comment = newComment;
	}
	/**
	 * Enter a comment for this item.
	 */
	public void setComment(String comment)
	{
	    this.comment = comment;
	}
	
	/**
	 * Return the comment for this item.
	 */
	public String getComment()
	{
	    return comment;
	}
	
	/**
	 * Set the flag indicating whether we own this item.
	 */
	public void setOwn(boolean ownIt)
	{
	    gotIt = ownIt;
	}
	
	/**
	 * Return information whether we own a copy of this item.
	 */
	public boolean getOwn()
	{
	    return gotIt;
	}
	    public void print()
    {
        System.out.print("item: " + title + " (" + playingTime + " mins)");
        if(gotIt) {
            System.out.println("*");
        } else {
            System.out.println();
        }
        System.out.println("    " + comment);
    }
}
