55 lines
1.1 KiB
Java
55 lines
1.1 KiB
Java
|
|
/**
|
|
* Subclass of AudioVisual to create objects of DVD items.
|
|
*
|
|
* @George Wilkinson
|
|
* @1.0
|
|
*/
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class DVD extends AudioVisual
|
|
{
|
|
private String director;
|
|
|
|
/**
|
|
* Constructor for objects of class DVD
|
|
* Since all field variables initialise as null, nothing should happen here.
|
|
*/
|
|
public DVD(){}
|
|
|
|
/*
|
|
* Return value of @director.
|
|
*/
|
|
public String getDirector()
|
|
{
|
|
return director;
|
|
}
|
|
|
|
/*
|
|
* Set value of @director.
|
|
*/
|
|
public void setDirector( String director )
|
|
{
|
|
this.director = director;
|
|
}
|
|
|
|
/*
|
|
* Print relevant details of the current object.
|
|
*/
|
|
public void printDetails() {
|
|
System.out.println( "Director: " + director );
|
|
super.printDetails();
|
|
}
|
|
|
|
/*
|
|
* Passed a scanner object, give the relevant variable a value.
|
|
*/
|
|
public void readItemData( Scanner detailScanner ){
|
|
if ( detailScanner != null ) {
|
|
this.director = detailScanner.next().trim();
|
|
super.readItemData( detailScanner );
|
|
}
|
|
}
|
|
}
|