Class Student
java.lang.Object
Student
Represents a
student who can rent spell books.
Each student is assigned a unique ID and maintains a record of current and past rentals.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCurrentSpellbooks(int serialNumber) Adds a spellbook to the list of currently rented books.voidaddToHistory(int serialNumber) Adds a spell book to the rental history.voidgetName()intvoidremoveSpellbook(int serialNumber) Removes a spell book from the list of currently rented books.static voidResets the student ID counter to its initial value between testcases.void
-
Constructor Details
-
Student
Constructs a newStudentwith a unique student ID and the given name.- Parameters:
name- the name of the student
-
-
Method Details
-
getNumber
public int getNumber() -
getName
-
getCurrentSpellbooks
-
getHistory
-
setName
-
addToCurrentSpellbooks
public void addToCurrentSpellbooks(int serialNumber) Adds a spellbook to the list of currently rented books.- Parameters:
serialNumber- the serial number of the spell book
-
addToHistory
public void addToHistory(int serialNumber) Adds a spell book to the rental history.- Parameters:
serialNumber- the serial number of the spell book
-
clearCurrentSpellbooks
public void clearCurrentSpellbooks() -
removeSpellbook
public void removeSpellbook(int serialNumber) Removes a spell book from the list of currently rented books.- Parameters:
serialNumber- the serial number of the spell book to remove
-
resetStudentId
public static void resetStudentId()Resets the student ID counter to its initial value between testcases.
-