vault backup: 2024-04-12 09:39:31

This commit is contained in:
2024-04-12 09:39:31 +01:00
parent e241fe8bd6
commit 30bfa6f243
73 changed files with 762 additions and 403 deletions

View File

@@ -0,0 +1,56 @@
/**
* Subclass of LibraryItem to create a periodical ( e.g. newspaper, tabloid ).
*
* @George Wilkinson
* @2.5
*/
import java.util.Scanner;
public class Periodical extends PrintedItem
{
private String publicationDate;
/**
* Constructor for objects of class Periodical
* Since all field variables initialise as null, nothing should happen here.
*/
public Periodical(){}
/*
* Return value of @publicationDate
*/
public String getPublicationDate()
{
return publicationDate;
}
/*
* Set value of @publicationDate
*/
public void setPublicationDate( String publicationDate )
{
this.publicationDate = publicationDate;
}
/*
* Print to terminal, relevant field variable's values.
*/
public void printDetails() {
System.out.println( "Publication Date: " + publicationDate );
super.printDetails();
}
/**
* Populate the fields with details from the scanner
* Takes Parameters
* Scanner @detailScanner
*/
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.publicationDate = detailScanner.next().trim();
super.readItemData( detailScanner );
}
}
}