vault backup: 2024-03-05 16:01:50

This commit is contained in:
2024-03-05 16:01:50 +00:00
parent 8ce640b4ba
commit 28ea6a0a9b
36 changed files with 314 additions and 89 deletions

View File

@@ -3,7 +3,7 @@
* Subclass of LibraryItem to create a periodical ( e.g. newspaper, tabloid ).
*
* @George Wilkinson
* @1.0
* @2.3
*/
import java.util.Scanner;
@@ -12,13 +12,39 @@ 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();
}
/*
* Passed a scanner, assign relevant values to field variables.
*/
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.publicationDate = detailScanner.next().trim();