From: Roland Haeder Date: Fri, 24 Jul 2015 10:34:37 +0000 (+0200) Subject: Sorted members X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9b17d1b8855a20655265b4e8de157ec55a328f18;p=jaddressbook-lib.git Sorted members Signed-off-by:Roland Häder --- diff --git a/Addressbook/src/org/mxchange/addressbook/manager/contact/ContactManager.java b/Addressbook/src/org/mxchange/addressbook/manager/contact/ContactManager.java index 8dc33aac..e950e42c 100644 --- a/Addressbook/src/org/mxchange/addressbook/manager/contact/ContactManager.java +++ b/Addressbook/src/org/mxchange/addressbook/manager/contact/ContactManager.java @@ -100,56 +100,6 @@ public class ContactManager extends BaseManager implements ManageableContact { throw new UnsupportedOperationException("Not supported yet."); } - /** - * Let the user change other address - */ - @Override - public void doChangeOtherAddress () { - throw new UnsupportedOperationException("Not supported yet."); - } - - /** - * Allows the user to change his/her own data - */ - @Override - public void doChangeOwnData () { - /* - * First check if the user has registered own contact, before that - * nothing can be changed. - */ - if (!this.isOwnContactAdded()) { - // Not added - this.getClient().outputMessage("Sie haben noch nicht Ihre Daten eingegeben."); - - // Skip any below code - return; - } - - // Instance - Contact contact = this.getOwnContact(); - - // It must be found - assert(contact instanceof Contact); - - // Display contact - contact.show(this.getClient()); - - try { - // Ask user what to change - this.getClient().userChooseChangeContactData(contact); - } catch (final UnhandledUserChoiceException ex) { - this.getLogger().catching(ex); - } - } - - /** - * Let the user delete other address - */ - @Override - public void doDeleteOtherAddress () { - throw new UnsupportedOperationException("Not supported yet."); - } - /** * Let the user change address data * @@ -198,6 +148,14 @@ public class ContactManager extends BaseManager implements ManageableContact { this.flush(); } + /** + * Let the user change other address + */ + @Override + public void doChangeOtherAddress () { + throw new UnsupportedOperationException("Not supported yet."); + } + /** * Let the user change other data * @@ -223,6 +181,48 @@ public class ContactManager extends BaseManager implements ManageableContact { this.flush(); } + /** + * Allows the user to change his/her own data + */ + @Override + public void doChangeOwnData () { + /* + * First check if the user has registered own contact, before that + * nothing can be changed. + */ + if (!this.isOwnContactAdded()) { + // Not added + this.getClient().outputMessage("Sie haben noch nicht Ihre Daten eingegeben."); + + // Skip any below code + return; + } + + // Instance + Contact contact = this.getOwnContact(); + + // It must be found + assert(contact instanceof Contact); + + // Display contact + contact.show(this.getClient()); + + try { + // Ask user what to change + this.getClient().userChooseChangeContactData(contact); + } catch (final UnhandledUserChoiceException ex) { + this.getLogger().catching(ex); + } + } + + /** + * Let the user delete other address + */ + @Override + public void doDeleteOtherAddress () { + throw new UnsupportedOperationException("Not supported yet."); + } + /** * Asks user for own data */ @@ -235,6 +235,16 @@ public class ContactManager extends BaseManager implements ManageableContact { this.registerContact(contact); } + @Override + public void doListContacts () { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void doSearchContacts () { + throw new UnsupportedOperationException("Not supported yet."); + } + /** * Shuts down this contact manager */ @@ -422,11 +432,6 @@ public class ContactManager extends BaseManager implements ManageableContact { return isAdded; } - @Override - public void doListContacts () { - throw new UnsupportedOperationException("Not supported yet."); - } - /** * Adds given contact to address book and flushes all entries to database * @@ -454,11 +459,6 @@ public class ContactManager extends BaseManager implements ManageableContact { this.flush(); } - @Override - public void doSearchContacts () { - throw new UnsupportedOperationException("Not supported yet."); - } - /** * Getter for size *