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> addressEntryList
    Collection variable that stores a set of AddressEntry objects that are currently in addressBook
    (package private) java.util.Scanner myObj  
  • Constructor Summary

    Constructors
    Constructor Description
    addressBook()  
  • Method Summary

    Modifier and Type Method Description
    void add​(addressEntry newEntry)
    Adds a new entry to AddressEntryList
    void find​(java.lang.String searchEntry)
    Finds an entry in the list by last name
    void list()
    Goes through AddressEntryList and print all entries in list
    static void readFromFile​(java.lang.String fileName, addressBook ab)
    Reads a file into the address book
    void removal​(java.lang.String delEntry)
    Removes an entry from the address book

    Methods 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

      private final java.util.ArrayList<addressEntry> 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.IOException
      Reads a file into the address book
      Parameters:
      fileName - file to be read
      ab - address book to add entries into
      Throws:
      java.io.IOException - if file not found
    • add

      public void add​(addressEntry newEntry)
      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