Package address.data
Class addressBook
java.lang.Object
address.data.addressBook
public class addressBook
extends java.lang.Object
addressBook is a class that creates a list of address entries and adds new entries
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<addressEntry>addressEntryListCollection variable that stores a set of AddressEntry objects that are currently in addressBook(package private) java.util.ScannermyObj -
Constructor Summary
Constructors Constructor Description addressBook() -
Method Summary
Modifier and Type Method Description voidadd(addressEntry newEntry)Adds a new entry to AddressEntryListvoidfind(java.lang.String searchEntry)Finds an entry in the list by last namevoidlist()Goes through AddressEntryList and print all entries in liststatic voidreadFromFile(java.lang.String fileName, addressBook ab)Reads a file into the address bookvoidremoval(java.lang.String delEntry)Removes an entry from the address bookMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
myObj
java.util.Scanner myObj -
addressEntryList
Collection variable that stores a set of AddressEntry objects that are currently in addressBook
-
-
Constructor Details
-
addressBook
public addressBook()
-
-
Method Details
-
readFromFile
public static void readFromFile(java.lang.String fileName, addressBook ab) throws java.io.IOExceptionReads a file into the address book- Parameters:
fileName- file to be readab- address book to add entries into- Throws:
java.io.IOException- if file not found
-
add
Adds a new entry to AddressEntryList- Parameters:
newEntry- new entry to add to the list
-
removal
public void removal(java.lang.String delEntry)Removes an entry from the address book- Parameters:
delEntry- entry to be removd from the list
-
find
public void find(java.lang.String searchEntry)Finds an entry in the list by last name- Parameters:
searchEntry- entry (or entries) to be found by last name
-
list
public void list()Goes through AddressEntryList and print all entries in list
-