librarytest
Class Library

java.lang.Object
  extended by librarytest.Library

public class Library
extends java.lang.Object

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

Library

public Library()
Method Detail

addItem

public boolean addItem(Item newItem)
1) Add a new item to the library

Parameters:
newItem -
Returns:
boolean

removeItem

public boolean removeItem(Item oldItem)
2) Remove an item from the library

Parameters:
oldItem -
Returns:
boolean

checkOutItem

public boolean checkOutItem(double cISBN,
                            int cPatID,
                            LibraryDate cDue)
3) Check out an item (input ISBN, the due date, the patron ID)

Parameters:
cISBN -
cPatID -
cDue -
Returns:
boolean

checkInItem

public 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

Parameters:
cISBN -
cPatID -
Returns:
double - amount of late fee if any

displayItem

public void displayItem(double dISBN)
5) Display one item with all item details (along with their specialization)

Parameters:
dISBN -

displayAllItems

public void displayAllItems()
Display all items


displayAvailableItems

public void displayAvailableItems()
6) Display all available item details


displayCheckedOutItems

public 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)


displayTypeItems

public void displayTypeItems(ItemType typ)
8) Display all items in a given specialization (enumeration type)

Parameters:
typ -

getItemISBN

public double getItemISBN(java.lang.String title,
                          java.lang.String publisher,
                          int pubYear)
9) Search for ISBN (input title, publisher, and publication year)

Parameters:
title -
publisher -
pubYear -
Returns:

findPatronID

public int findPatronID(java.lang.String first,
                        java.lang.String last)
20) Find a patron ID from the first and last name

Parameters:
first -
last -
Returns:

findPatronName

public java.lang.String findPatronName(double pID)
21) Find the first and last name from a patron ID

Parameters:
pID -
Returns:

displayPatronItems

public void displayPatronItems(double pID)
22) Display all items checked out by a specific patron (input Patron ID)

Parameters:
pID -

clockIn

public void clockIn(int eID)
30) Clock in an employee

Parameters:
eID -

clockOut

public void clockOut(int eID)
31) Clock out an employee

Parameters:
eID -

hireEmployee

public boolean hireEmployee(Employee e)
32) Hire an employee

Parameters:
e -
Returns:
boolean

fireEmployee

public boolean fireEmployee(Employee e)
34) Remove (fire) an employee

Parameters:
e -
Returns:
boolean

calculatePayForMonth

public double calculatePayForMonth(Employee e,
                                   double hrs)
33) Calculate pay for an employee (hourly employees are rate times hours worked; salary get monthly amt)

Parameters:
e -
hrs -
Returns:
double - pay amount

displayEmployees

public void displayEmployees()
35) Display all employee details (along with their specialization)


addPatron

public boolean addPatron(Patron p)
Parameters:
p -
Returns:

removePatron

public boolean removePatron(Patron p)
Parameters:
p -
Returns:

displayPatrons

public void displayPatrons()