56 lines
1.1 KiB
Java
56 lines
1.1 KiB
Java
|
|
/**
|
|
* Subclass of LibraryItem to create objects of audio and visual items in a library.
|
|
*
|
|
* @George Wilkinson
|
|
* @1.2
|
|
*/
|
|
|
|
import java.util.Scanner;
|
|
|
|
public abstract class AudioVisual extends LibraryItem
|
|
{
|
|
private int playingTime;
|
|
|
|
/*
|
|
* Field Accessor Start
|
|
*/
|
|
public int getPlayingTime()
|
|
{
|
|
return playingTime;
|
|
}
|
|
|
|
/*
|
|
* Field Accessor End
|
|
*
|
|
* Field Mutator Start
|
|
*/
|
|
|
|
public void setPlayingTime( int playingTime )
|
|
{
|
|
this.playingTime = playingTime;
|
|
}
|
|
|
|
/*
|
|
* Field Mutator End
|
|
*/
|
|
|
|
public void printDetails()
|
|
{
|
|
System.out.println( "Playing Time: " + playingTime );
|
|
super.printDetails();
|
|
}
|
|
|
|
/**
|
|
* Populate the fields with details from the scanner
|
|
* Takes Parameters
|
|
* Scanner @detailScanner
|
|
*/
|
|
public void readItemData( Scanner detailScanner ){
|
|
if ( detailScanner != null ) {
|
|
this.playingTime = Integer.parseInt( detailScanner.next().trim() );
|
|
super.readItemData( detailScanner );
|
|
}
|
|
}
|
|
}
|