/**
 * The Item class represents a multi-media object. Information about the 
 * object is stored and can be retrieved.
 *
 *@author Michael Kölling and David J. Barnes
 *@updates and changes by Michael Rivers
 *@version April 13th 2006
 */
public class Item
{
    private String title;
    private int playingTime;
    private boolean gotIt;
    private String comment;
    
    /**
     * Default Constructor
     */
    public Item()
    {
        title = "title unavailable";
        playingTime = 0;
        gotIt = false;
        comment = "No comment";
    }
    
    /**
     * Initialise the fields of the item
     */
    public Item(String theTitle, int time)
    {
        title = theTitle;
        playingTime = time;
        gotIt = false;
        comment = "No Comment";
    }
    
    /**
     * Constructor with "got it" parameter
     */
    public Item(String theTitle, int time, boolean haveIt)
    {
        title = theTitle;
        playingTime = time;
        gotIt = haveIt;
        comment = "No Comment";
    }
       
    /**
     * Constructor with "got it" and comment parameters
     */
    public Item(String theTitle, int time, boolean haveIt, String comment)
    {
        title = theTitle;
        playingTime = time;
        gotIt = haveIt;
        this.comment = comment;
    }
    
    /**
     * This constructor does not require a time parameter
     * (useful for video games where time is not relevant)
     */
    public Item(String theTitle)
    {
        title = theTitle;
        playingTime = 0;
        gotIt = false;
        comment = "No Comment";
    }
    
     /**
     * This constructor does not require time as an input
     * and has a parameter for "got it" and comment
     */
    public Item(String theTitle, boolean haveIt)
    {
        title = theTitle;
        playingTime = 0;
        gotIt = haveIt;
        comment = "No Comment";
    }
    
    /**
     * This constructor does not require time as an input
     * and has a parameter for "got it" and comment 
     */
    public Item(String theTitle, boolean haveIt, String comment)
    {
        title = theTitle;
        playingTime = 0;
        gotIt = haveIt;
        this.comment = comment;
    }

    /**
     * Set or change the title
     */
    public void setTitle(String theTitle)
    {
        title = theTitle;
    }
    
    /**
     * Return the title of the item
     */
    public String getTitle()
    {
        return title;
    }
    
    /**
     * Set or change the playing time of the item
     */
    public void setPlayingTime(int time)
    {
        playingTime = time;
    }
    
    /**
     * 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;
    }
    
    /** 
     * Print the information about the item
     */
    public void print()
    {
        System.out.print("" + title + " (" + playingTime + " mins)");
        if(gotIt) {
            System.out.println("*");
        } else {
            System.out.println();
        }
        System.out.println("    " + comment);
    }
}
