public class ContactDatabase
extends java.lang.Object
Constructor and Description |
---|
ContactDatabase()
Creates a new instance of ContactDatabase instantiating an empty
arraylist.
|
Modifier and Type | Method and Description |
---|---|
void |
addContact(Contact contact)
Adds a new contact to the list.
|
int |
getNoOfContacts()
Returns the total number of contacts.
|
boolean |
isEmpty()
Determines if the contact list is empty.
|
void |
loadContactList(java.lang.String fileName)
Loads a contact list from the specified file.
|
void |
print() |
void |
saveContactList(java.lang.String fileName)
Saves the contact list to the specified file.
|
java.lang.String |
toString()
Returns a string representation of the contact database.
|
public ContactDatabase()
public void addContact(Contact contact)
public int getNoOfContacts()
public boolean isEmpty()
public void loadContactList(java.lang.String fileName)
public void print()
public void saveContactList(java.lang.String fileName)
public java.lang.String toString()
toString
in class java.lang.Object