
// DVD.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th

/**
 * The DVD class represents a DVD object. Information about the 
 * DVD is stored and can be retrieved. We assume that we only deal 
 * with movie DVDs at this stage.
 * 
 * @author Michael Kolling and David J. Barnes
 * @version 2006.03.30
 */


public class DVD 
{
  private String title, director, comment;
  private int playingTime; // playing time of the movie
  private boolean gotIt;


  public DVD(String theTitle, String theDirector, int time)
  {
    title = theTitle;
    director = theDirector;
    playingTime = time;
    gotIt = false;
    comment = null;
  }  // end of DVD()


  public void setComment(String com)
  {  comment = com;  }


  public String getComment()
  { return comment;  }


  public void setOwn(boolean ownIt)
  // set the flag indicating whether we own this DVD.
  {  gotIt = ownIt;  }


  public boolean getOwn()
  // return true if we own a copy of this DVD.
  {  return gotIt; }


  public void print()
  // print details about this DVD
  {
    System.out.print("DVD: " + title + " (" + playingTime + " mins)");
    if (gotIt)
      System.out.println("*");
    else
      System.out.println();
    System.out.println("    " + director);
    if (comment != null)
      System.out.println("    " + comment);
  }  // end of print()

}  // end of DVD class
