diff --git a/src/seedu/addressbook/data/AddressBook.java b/src/seedu/addressbook/data/AddressBook.java index 537d35c89..795ed7ee3 100644 --- a/src/seedu/addressbook/data/AddressBook.java +++ b/src/seedu/addressbook/data/AddressBook.java @@ -38,6 +38,15 @@ public void addPerson(Person toAdd) throws DuplicatePersonException { allPersons.add(toAdd); } + /*prints out name if duplicate is found*/ + + public void nameOfDuplicate (ReadOnlyPerson key) { + if (containsPerson(key)==true){ + String duplicate = "This user is already in the system"; + System.out.println(duplicate); + } + } + /** * Returns true if an equivalent person exists in the address book. */