Home / Expert Answers / Computer Science / complete-in-java-using-arraylist-and-or-linkedlist-nbsp-nbsp-nbsp-nbsp-nbsp-nb-pa897

(Solved): *Complete in Java using arrayList and/or linkedList.*          &nb ...



*Complete in Java using arrayList and/or linkedList.*

Contact directories have been used for decades. They have been utilized in telephones ever since the first telephone director

 

Contact Directory Design
The directory to be designed will consist of a list of contact cards. Each contact card will contain

  

Input Data
The input for the program is to be read from one data file located in a directory called inputFiles within your Ec

 

Technical Details
Contact Card
You must create a ContactCard class, such that an instance of this class can store all of the

 

A call to recommendedFriends (contact1) returns \( \{ \) contact 6 , contact 8\( \} \), where contact \( 6 \& \) contact8 are

 

Contact directories have been used for decades. They have been utilized in telephones ever since the first telephone directory, consisting of a single piece of cardboard, was issued on February 21 st, 1878. It listed 50 individuals, businesses, and other offices in New Haven, Connecticut that had telephones. Since then, the concept of contact directories has transitioned into other similar ideas that have revolutionized the industry, such as relational databases (e.g. PostgreSQL, MySQL). A contact directory consists of a collection of contact cards that hold important information of a particular person that is relevant to the application that it is made for. For example, a contact directory for a university's faculty may contain cards for each faculty member. And each card would have information such as their name, email, phone, office, related contacts, etc. You will write a program that designs a custom contact directory system using the constructs of the Java Programming Language, Object-Oriented Programming, and the List ADT discussed in lectures. Contact Directory Design The directory to be designed will consist of a list of contact cards. Each contact card will contain all the information about a particular person that is included in the directory and is important. Each contact card will also contain a list of external contact cards that represent the friends of that contact card. The information of each contact card will be the following: - Reference ID Number - This is to look up said contact card in the main directory and protect the information of the contact - Name - Birthday - The date will be in the format of Month, Day, Year - Job Title - Phone Number - E-mail Address - Friends - This will be a list of friends Consider the following diagram that represents an example of a small contact directory: Notice that each contact has a list of contacts that contain references to other contacts inside the directory. An example of this is the contact with ID 4, this contact has 3 friends of ID 5, 6, 32 . The contact of ID 4 will store the contact cards of his friends inside his own contact card, hence the arrows "pointing" to the other contact. This is similar to how iPhones store "favorite" contacts in your directory. Input Data The input for the program is to be read from one data file located in a directory called inputFiles within your Eclipse project. directory.csv: Contains the data about the contacts of that specific directory. Each line will represent a different contact from the directory and will be in the following format: Where each field of the contact card is separated by commas, in this example the contact card is the following: - ID Number: 1 - Name: - Job Title: Instructor - Phone Number - E-mail Address - Birthday: October 28, 2000 - Friends: 2, 3, 6 Notes: - The birthdates are in the form of year-month-day and need to be stored in an object of type Date. - The ID number will be an arbitrary number. - The fields after the birthday are the id numbers of the friends that card has. - In this example, Fernando's friends are the contacts with id's 2, 3 \& 6 - Example: The contact with id 6 is Alejandra Muñoz - You can assume that if the card has a friend's id, then there exists a contact card that will have that reference id. - You can take a look at the Java API for more information on the BufferedReader \& Date classes that can help you work with reading files \& storing dates. Technical Details Contact Card You must create a ContactCard class, such that an instance of this class can store all of the information regarding a single contact inside the directory. It must contain a reference id number to be able to lookup said card in the directory. It must also contain the important information about the contact such as name, job title, phone number, e-mail address, and birthday. Finally, it will also contain a Linked List to store all the ContactCard instances that person has saved as its favorites (similar to what you can do in your iPhone's contact list). The type of list you use (Singly or Doubly Linked) is up to you. If the contact card has no friends, then the instance of that contact card will contain an empty list. This class must follow all the design paradigms of Object-Oriented Programming (private fields, getters/setters, etc.), you will lose points if any of these are missing. Directory Class Your main program must be named Directory . java and it must implement all of the aforementioned logic \& key algorithms using the ContactCard class you created. To implement your key algorithms \& csv parsing, your Directory class must contain at least the following methods that are provided in the Basedirectory Interface: // Parses the csv in a given path and creates the directory public void createdirectory (String path); /* Returns a list of ContactCards that represent all of the cards the contact passed as a parameter does not have marked as favorite, but his favorites do have marked as favorite. Similar to Facebook's "People You May Know", friends of friends who are not friends with you. The List shouldn't have duplicates.*/ public List recommendedFriends (ContactCard contact) ; An example for this method is as follows, assume you have a directory with these two contact cards: A call to recommendedFriends (contact1) returns \( \{ \) contact 6 , contact 8\( \} \), where contact \( 6 \& \) contact8 are Contactcard instances with the reference ID \( 6 \& \) 8 respectively since contact 1 has as favorite contact2, but contact1 does not have marked as favorite contact \( 6 \& \) contact8. \( 1 / \) Returns a list of common friends between 2 contact cards public List commonfriends (ContactCard c1, ContactCard c2); // Returns a list of friends who share the same birthday as the contact passed as parameter public List sameBirthday (ContactCard c); // Returns a list of all the contacts in the Directory public List getContacts \( ( \) ) ; You can add extra methods to the Basedirectory interface if you wish, but you must implement said interface and all the pre-defined methods in the Directory class. You must use only locally defined data structures; you cannot use Java's built-in List structures. However, you can be creative as to how you use them for convenience purposes when designing your algorithms.


We have an Answer from Expert

View Expert Answer

Expert Answer


Contact-management-using-doubly-linked-list: #Phonebook management have three main operations: #1.Searching #2.Sorting #3.Deleting These three operati
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe