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 that emulates a Book item.
*
* @George Wilkinson
* @1.0
* @2.3
*/
import java.util.Scanner;
@@ -15,15 +15,54 @@ public class Book extends PrintedItem
/**
* Constructor for objects of class Book
* Since all field variables initialise as null, nothing should happen here.
*/
public Book(){}
/*
* Return value of @author
*/
public String getAuthor()
{
return author;
}
/*
* Return value of @isbn.
*/
public String getIsbn()
{
return isbn;
}
/*
* Set value of @author.
*/
public void setAuthor( String author )
{
this.author = author;
}
/*
* Set value of @isbn
*/
public void setIsbn( String isbn )
{
this.isbn = isbn;
}
/*
* Print to terminal, relevant details of current object.
*/
public void printDetails() {
System.out.println( "ISBN: " + isbn +
"\nAuthor: " + author );
super.printDetails();
}
/*
* Passed a scanner object, set field variables to corresponding values.
*/
public void readItemData( Scanner detailScanner ){
if ( detailScanner != null ) {
this.author = detailScanner.next().trim();