|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlibrarytest.Library
public class Library
The Library class has data elements: libraryContents - Use ArrayList and Item class, patronList – Use any collection class (such as ArrayList) and the Patron class, employeeList – Use any collection class (such as ArrayList) and the Employee class. Has methods: 1) Add a new item to the library 2) Remove an item from the library 3) Check out an item (input ISBN, the due date, the patron ID) 4) Check in an item (input ISBN, the patron ID) - should return a fee amount if the item is overdue 5) Display one item with all item details (along with their specialization) 6) Display all available item details 7) Display all checked-out items (including due date and how many days are left before the due date or how many days the item is overdue) 8) Display all items in a given specialization (enumeration type) 9) Search for ISBN (input title, publisher, and publication year) 20) Find a patron ID from the first and last name 21) Find the first and last name from a patron ID 22) Display all items checked out by a specific patron (input Patron ID) 30) Clock in an employee (Doesn't record time) 31) Clock out an employee (Doesn't record time) 32) Hire an employee 33) Calculate pay for an employee - hourly employees are rate times hours worked; salary get monthly amt 34) Remove (fire) an employee 35) Display all employee details (along with their specialization)
Constructor Summary | |
---|---|
Library()
|
Method Summary | |
---|---|
boolean |
addItem(Item newItem)
1) Add a new item to the library |
boolean |
addPatron(Patron p)
|
double |
calculatePayForMonth(Employee e,
double hrs)
33) Calculate pay for an employee (hourly employees are rate times hours worked; salary get monthly amt) |
double |
checkInItem(double cISBN,
int cPatID)
4) Check in an item (input ISBN, the patron ID) should return a fee amount if the item is overdue |
boolean |
checkOutItem(double cISBN,
int cPatID,
LibraryDate cDue)
3) Check out an item (input ISBN, the due date, the patron ID) |
void |
clockIn(int eID)
30) Clock in an employee |
void |
clockOut(int eID)
31) Clock out an employee |
void |
displayAllItems()
Display all items |
void |
displayAvailableItems()
6) Display all available item details |
void |
displayCheckedOutItems()
7) Display all checked-out items (including due date and how many days are left before the due date or how many days the item is overdue) |
void |
displayEmployees()
35) Display all employee details (along with their specialization) |
void |
displayItem(double dISBN)
5) Display one item with all item details (along with their specialization) |
void |
displayPatronItems(double pID)
22) Display all items checked out by a specific patron (input Patron ID) |
void |
displayPatrons()
|
void |
displayTypeItems(ItemType typ)
8) Display all items in a given specialization (enumeration type) |
int |
findPatronID(java.lang.String first,
java.lang.String last)
20) Find a patron ID from the first and last name |
java.lang.String |
findPatronName(double pID)
21) Find the first and last name from a patron ID |
boolean |
fireEmployee(Employee e)
34) Remove (fire) an employee |
double |
getItemISBN(java.lang.String title,
java.lang.String publisher,
int pubYear)
9) Search for ISBN (input title, publisher, and publication year) |
boolean |
hireEmployee(Employee e)
32) Hire an employee |
boolean |
removeItem(Item oldItem)
2) Remove an item from the library |
boolean |
removePatron(Patron p)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Library()
Method Detail |
---|
public boolean addItem(Item newItem)
newItem
-
public boolean removeItem(Item oldItem)
oldItem
-
public boolean checkOutItem(double cISBN, int cPatID, LibraryDate cDue)
cISBN
- cPatID
- cDue
-
public double checkInItem(double cISBN, int cPatID)
cISBN
- cPatID
-
public void displayItem(double dISBN)
dISBN
- public void displayAllItems()
public void displayAvailableItems()
public void displayCheckedOutItems()
public void displayTypeItems(ItemType typ)
typ
- public double getItemISBN(java.lang.String title, java.lang.String publisher, int pubYear)
title
- publisher
- pubYear
-
public int findPatronID(java.lang.String first, java.lang.String last)
first
- last
-
public java.lang.String findPatronName(double pID)
pID
-
public void displayPatronItems(double pID)
pID
- public void clockIn(int eID)
eID
- public void clockOut(int eID)
eID
- public boolean hireEmployee(Employee e)
e
-
public boolean fireEmployee(Employee e)
e
-
public double calculatePayForMonth(Employee e, double hrs)
e
- hrs
-
public void displayEmployees()
public boolean addPatron(Patron p)
p
-
public boolean removePatron(Patron p)
p
-
public void displayPatrons()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |