class PersonManager
extends java.lang.Object
Constructor and Description |
---|
PersonManager()
The constructor for PersonManager creates an ArrayList of Person objects
called
peopleDB . |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addUser(java.util.Scanner kb) |
java.util.ArrayList<Person> |
getPersonDB()
This method returns the runtime database peopleDB
|
(package private) boolean |
readDB()
Attempts to read in from the database file called
people.db
and load each person's info into the runtime people database. |
boolean |
saveDB()
Attempts to write the existing runtime people database to the people database file.
|
(package private) int |
search(int s)
This method searches the runtime people database for a given
UID.
|
(package private) boolean |
updateUser(java.util.Scanner kb)
This method allows updating existing users information.
|
boolean |
validateUID(int UID,
java.lang.String type)
Given a UID and a type of person, attempts to validate whether or not the user
is listed in the database as the provided type of person (customer or employee)
|
public PersonManager()
peopleDB
. This ArrayList will serve as the runtime
people database.public java.util.ArrayList<Person> getPersonDB()
boolean addUser(java.util.Scanner kb)
boolean updateUser(java.util.Scanner kb)
kb
- The scanner object for console input and outputpublic boolean validateUID(int UID, java.lang.String type)
UID
- An int that is the UID of the person being sought.type
- The type of person to verify (employee or customer)int search(int s)
s
- The UID to search the database forpublic boolean saveDB()
boolean readDB()
people.db
and load each person's info into the runtime people database.peopleDB
, false otherwise.