|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectairline.AirlineSystem.UserDB
private class AirlineSystem.UserDB
A container of existing system Users.
| Field Summary | |
|---|---|
private HashMap<String,User> |
map
We maintain underlying collection as a HashMap |
| Constructor Summary | |
|---|---|
AirlineSystem.UserDB()
Creates an initially empty database. |
|
| Method Summary | |
|---|---|
void |
add(User usr)
Adds a User to the system. |
User |
getUser(String ID)
Returns the User associated with the given ID. |
Iterator<User> |
iterator()
Returns an iterator of User instances. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private HashMap<String,User> map
| Constructor Detail |
|---|
public AirlineSystem.UserDB()
| Method Detail |
|---|
public void add(User usr)
throws IllegalArgumentException
User to the system.
The caller is responsible for ensuring that the new customer has been properly configured
prior to entry into the system.
usr - the new User
IllegalArgumentException - if system has existing customer with same ID.public User getUser(String ID)
User associated with the given ID.
Returns null if the ID is not found.
ID - The customer ID
User instance; null if ID not found.public Iterator<User> iterator()
User instances.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||