123456789101112131415161718192021222324252627 |
- import java.util.TreeMap;
- import java.util.Map;
- import java.util.ArrayList;
-
- /**
- * Created by leon on 1/23/18.
- */
- public class PhoneBook {
- Map<String,Entry> phonebook = new TreeMap<String,Entry>();
- public PhoneBook(){
-
- }
-
- public void addEntry(String name, String phoneNumber){
- Entry newEntry = new Entry(phoneNumber);
- phonebook.put(name,newEntry);
- }
-
- public Entry getEntry(String name){
- return phonebook.get(name);
- }
-
-
-
-
- }
|