]> git.mxchange.org Git - addressbook-swing.git/blobdiff - src/org/mxchange/addressbook/client/AddressbookClient.java
Updated copyright year
[addressbook-swing.git] / src / org / mxchange / addressbook / client / AddressbookClient.java
index 79fd0a2481c55f2ff6354dcd7e2a2c83d57304ad..db27b04932d3ce27b80c4b21e8d99a70dcc663f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 package org.mxchange.addressbook.client;
 
 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcore.client.Client;
-import org.mxchange.jcore.contact.Contact;
-import org.mxchange.jcore.contact.gender.Gender;
+import org.mxchange.jcore.exceptions.MenuInitializationException;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
 
 /**
  * A special client interface for addressbook applications.
- * 
+ * <p>
  * @author Roland Haeder
  */
 public interface AddressbookClient extends Client {
 
        /**
-        * The user changes own name data
-        *
-        * @param contact
+        * Displays a "box" for the address
+        * <p>
+        * @param contact Contact to show address from
         */
-       public void doChangeOwnNameData (final Contact contact);
+       void displayAddressBox (final Contact contact);
 
        /**
-        * The user changes own address data
-        *
-        * @param contact Contact instance to change
+        * Displays a "box" for the name
+        * <p>
+        * @param contact Contact to show name from
         */
-       public void doChangeOwnAddressData (final Contact contact);
+       void displayNameBox (final Contact contact);
 
        /**
-        * The user changes own other data
-        *
-        * @param contact Constact instance to change
+        * Displays a "box" for other data
+        * <p>
+        * @param contact Contact to show other data from
         */
-       public void doChangeOwnOtherData (final Contact contact);
+       void displayOtherDataBox (final Contact contact);
 
        /**
-        * Allows the user to enter own data
-        *
-        * @return Finished Contact instance
+        * Shows given contact instamce
+        * <p>
+        * @param contact Contact instance
         */
-       public Contact doEnterOwnData ();
+       void show (final Contact contact);
 
        /**
-        * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
-        *
-        * @param message Message to output
-        * @return Gender enum
+        * The user changes own address data
+        * <p>
+        * @param contact Contact instance to change
         */
-       public Gender enterGender (final String message);
+       void doChangeOwnAddressData (final Contact contact);
 
        /**
-        * Let the user choose what to change on the address: [n]ame, [a]ddress,
-        * [o]ther
-        *
-        * @param contact Contact instance to let the user change data
-        * @throws UnhandledUserChoiceException If choice is not supported
+        * The user changes own name data
+        * <p>
+        * @param contact
         */
-       public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
+       void doChangeOwnNameData (final Contact contact);
+
+       /**
+        * The user changes own other data
+        * <p>
+        * @param contact Constact instance to change
+        */
+       void doChangeOwnOtherData (final Contact contact);
+
+       /**
+        * Allows the user to enter own data
+        * <p>
+        * @return Finished Contact instance
+        */
+       Contact doEnterOwnData ();
 
        /**
         * Asks the user for a choice and proceeds accordingly
-        *
+        * <p>
         * @throws UnhandledUserChoiceException If choice is not supported
+        * @throws org.mxchange.jcore.exceptions.MenuInitializationException If the
+        * menu cannot be initialized
         */
-       public void doUserMenuChoice () throws UnhandledUserChoiceException;
+       void doUserMenuChoice () throws UnhandledUserChoiceException, MenuInitializationException;
 
        /**
         * Asks the the user to enter a single character which must match validChars
-        *
+        * <p>
         * @param       validChars Valid chars that are accepted
         * @param       message Message to user
+        * <p>
         * @return      Allowed character
         */
-       public char enterChar (final char[] validChars, final String message);
+       char enterChar (final char[] validChars, final String message);
 
        /**
-        * Reads a string of minimum and maximum length from the user. An empty
-        * string should be generally not allowed, but might be okay for e.g.
-        * company name.
-        *
-        * @param minLength     Minimum length of the string to read
-        * @param maxLength     Maximum length of the string to read
-        * @param message       Message to user
-        * @param allowEmpty Whether empty strings are allowed
-        * @return Entered string by user or null if empty string is allowed
+        * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
+        * <p>
+        * @param message Message to output
+        * <p>
+        * @return Gender enum
         */
-       public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
+       Gender enterGender (final String message);
 
        /**
         * Reads an integer (int) from the user
-        *
+        * <p>
         * @param minimum Minimum allowed number
         * @param maximum Maximum allowed number
         * @param message       Message to user
+        * <p>
+        * @return Entered string by user or null if empty string is allowed
+        */
+       int enterInt (final int minimum, final int maximum, final String message);
+
+       /**
+        * Reads a string of minimum and maximum length from the user. An empty
+        * string should be generally not allowed, but might be okay for e.g.
+        * company name.
+        * <p>
+        * @param minLength     Minimum length of the string to read
+        * @param maxLength     Maximum length of the string to read
+        * @param message       Message to user
+        * @param allowEmpty Whether empty strings are allowed
+        * <p>
         * @return Entered string by user or null if empty string is allowed
         */
-       public int enterInt (final int minimum, final int maximum, final String message);
+       String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
 
        /**
         * Setter for current menu choice
-        *
+        * <p>
         * @param currentMenu Current menu choice
         */
-       public void setCurrentMenu (final String currentMenu);
+       void setCurrentMenu (final String currentMenu);
 
        /**
         * Some "Getter" for menu item
-        *
+        * <p>
         * @param accessKey Key to press to access this menu
         * @param text Text to show to user
+        * <p>
         * @return
         */
-       public SelectableMenuItem getMenuItem (final char accessKey, final String text);
+       SelectableMenuItem getMenuItem (final char accessKey, final String text);
+
+       /**
+        * Shows current menu selection to the user
+        */
+       void showCurrentMenu ();
 
        /**
         * Shows given menu entry in client
-        *
+        * <p>
         * @param item Menu item to show
         */
-       public void showEntry (final SelectableMenuItem item);
+       void showEntry (final SelectableMenuItem item);
 
        /**
-        * Shows current menu selection to the user
+        * Let the user choose what to change on the address: [n]ame, [a]ddress,
+        * [o]ther
+        * <p>
+        * @param contact Contact instance to let the user change data
+        * <p>
+        * @throws UnhandledUserChoiceException If choice is not supported
         */
-       public void showCurrentMenu ();
+       void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
 }