|
@@ -11,12 +11,13 @@ public class PhoneBook{
|
11
|
11
|
List<String> multipleNumbers = new LinkedList<>();
|
12
|
12
|
// public static boolean electronicPhonebook = true;
|
13
|
13
|
// Scanner input = new Scanner(System.in);
|
14
|
|
- // Collection<String> c;
|
15
|
|
- // Iterator<String> iter = c.iterator();
|
|
14
|
+ // HashMap<List, String> c;
|
|
15
|
+ // Iterator<String> iter = c.iterator();
|
16
|
16
|
public PhoneBook(){
|
17
|
17
|
}
|
18
|
|
- public void add(List multipleNumbers, String name){
|
19
|
|
- phonebook.put(multipleNumbers, name);
|
|
18
|
+
|
|
19
|
+ public void add(List <String> number, String name){
|
|
20
|
+ phonebook.put(number, name);
|
20
|
21
|
}
|
21
|
22
|
|
22
|
23
|
public void remove(String name){
|
|
@@ -31,6 +32,10 @@ public class PhoneBook{
|
31
|
32
|
return phonebook.get(number);
|
32
|
33
|
}
|
33
|
34
|
|
|
35
|
+ // public void removeRecord(){
|
|
36
|
+ // iter.forEachRemaining(Map<List, String>, iter.remove(List));
|
|
37
|
+ // }
|
|
38
|
+
|
34
|
39
|
public void display(){
|
35
|
40
|
System.out.println(" ***** WLECOME TO THE WORLD BOOK ***** ");
|
36
|
41
|
for (Map.Entry<List,String> entry : phonebook.entrySet()){
|